How to Upload Apps into KOBITON by Using POSTMAN

Reading Time : 2min read
Graphic of three pillers each with a computer screen

Kobiton has long supported the ability for end-users to upload their apps to the Kobiton App Repository, either via the UI or via the REST API. It is intended to help users manage new and existing versions of their applications within the Kobiton cloud. Users can add any number of apps to the App Repository and also create restricted access if necessary. Today, I would like to introduce another way to upload apps into Apps Repo using Postman.

Create Environment

We need to create some variables on Postman to reuse those on our requests. There are some required variables username, apiKey, host, and filename. For examples:

  • username: joeybrown
  • apiKey: 3bfd8955-e252-4754-bffd-beb057b2b849
  • host: https://api.kobiton.wpengine.com
  • filename: /Users/joeybrown/Downloads/ApiDemos-debug.apk
Screen shot of postman environmental variables

Upload Apps

Generate Upload URL

  1. On the Params tab, create a POST request with URL = {{host}}/v1/apps/uploadUrl
  2. On the Authorizarion tab, choose Type = Basic Auth
    • Username = {{username}}
    • Password = {{apiKey}}
  3. On the Headers tab, add Content-Type = application/json
  4. On the Body tab, switch to raw data with JSON format.
    • The file data is

{

“filename” :“{{filename}}”,

“appPath” : “{{appPath}}”

}

5. On Tests tab, we will parse the response data and set appPath and appUrl as variables with three lines below:

var data = JSON.parse(responseBody);

postman.setEnvironmentVariable(“appPath”, data.appPath);

postman.setEnvironmentVariable(“appUrl”, data.url);

After that, we click the Send button to send the request to the Kobiton server. The output looks like below. The appPath and url are saved to the variables.

Screen shot of output of the kobiton request

Upload File To S3

  1. Create PUT request with URL = {{appURL}}
  2. On the Headers tab, add Content-Type = application/json and x-amz-tagging = unsaved=true
  3. On the Body tab, browse to the file that we want to upload (ApiDemos-debug.apk)
  4. Then click the Send button, the response status code 200 will be returned.
Screen shot of code that is the response status code 200

Create Application Or Version

  1. Create POST request with URL = {{host}}/v1/apps
  2. On the Authorizarion tab, choose Type = Basic Auth
    • Username = {{username}}
    • Password = {{apiKey}}
  3. On the Body tab, switch to raw data with JSON format.

{

“filename” :“{{filename}}”,

“appPath” : “{{appPath}}”

}

4. Then click the Send button, the appId and versionId are returned.

We can double-check by accessing https://portal.kobiton.com/login and filter the appId.

Interested in Learning More?

Subscribe today to stay informed and get regular updates from Kobiton

Ready to accelerate delivery of
your mobile apps?

Request a Demo