Upload an app using the Kobiton API

Learn how to upload an app to the app repository using our REST API.

Configure your authorization header

To ensure your credentials are kept secure, all requests sent to https://api.kobiton.com/ must contain an Authentication header. Credentials assigned to your authorization header need to be in base64 format.

In your terminal, convert your Kobiton API credentials to base64 format using the following command:

echo -n "${yourUserNameOrEmail}:${yourApiKey}" | base64

Copy the generated string and save it in a secure location for later.

Generate an upload URL

In the terminal, make a POST request to /apps/uploadUrl, which will generate a unique upload URL that connects to our private S3 bucket on Amazon Web Services (AWS).

# You can also use wget
curl -X POST https://api.kobiton.com/v1/apps/uploadUrl \
  -H 'Authorization: Basic ${yourBase64String}' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
  "filename": "${appFilename}",
  "appId": 1
}'

A successful response will return the following:

Example
{
    "appPath": "users/1/apps/app‐prod‐debug‐237824a0‐302c‐9bfd‐ff417c89610a.apk",
    "url": "https://kobiton-us.s3.amazonaws.com/users/1/apps/app‐f417c89610a.apk?AWSAccessKeyId=AKINQ57IQCo"
}

Save these values for the following sections.

Send app to S3

Make a PUT request using the url you generated in the previous step.

# You can also use wget
curl -X PUT ${generatedUrl} \
  -H "Content-Type: application/octet-stream" \
  -H "x-amz-tagging: unsaved=true" \
  -T ${filePath} \

A successful PUT request will return a 200 status.

Initiate upload

Make a POST request to initiate your upload to the app repository in Kobiton. Be sure to upload a supported filetype.

# You can also use wget
curl -X POST https://api.kobiton.com/v1/apps \
    -H 'Authorization: Basic ${yourBase64String}' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{
        "filename": "${appFilename}",
        "appPath": "${generatedAppPath}"
        }'

If your request was successful, POST will return a 200 status, then the API will extract your app’s metadata, preform security checks, and upload the app to your library.