Example: Adding an App

This example walks you through adding an app to the Akana API Platform by using the API rather than the user interface. One use of this sequence is to build code that will load multiple apps via the platform. This could be useful if you are just getting started on the platform and have many apps.

This exercise assumes that you already have a valid login for the Akana API Platform. You can't add an app unless you're an authorized user. Before running the procedures below, go into the user interface to set up your user profile.

Essentially, you'll need to complete these two activities, in sequence:

  1. Log in using your authorized user profile you've already set up. Operation: POST /api/login.
  2. Create an app. This also adds the first app version. Operation: POST /api/apps.

Once you've completed the above steps, the AppID is returned in the response and the app is ready for use.

Follow the detailed instructions below.

To add an app in the Akana API Platform using the API

  1. Log in via the API, POST /api/login operation, using your own email and password in the body of the operation instead of the placeholder values given below.
    • HTTP method: POST
    • URL: https://{hostname}/api/login
    • Accept header: application/json
    • Content-Type header: application/json
    • CSRF header: include it if needed. If you are not sure whether it's needed or not, refer to CSRF Prevention on the Platform.
    • Request Body:
      {
        "email":"MyEmailAddress",
        "password":"MyPassword"
      }
  2. Add the app, using the POST /api/apps operation. In your API call, use the values below, modifying the URL path as needed, and filling your own values for all fields in the Request Body (URL encoding not needed). Tags are optional, but all other values are required.
    • HTTP method: POST
    • URL: https://{hostname}/api/apps
    • Accept header: text/plain
    • Content-Type header: application/json
    • CSRF header: include it if needed. If you are not sure whether it's needed or not, refer to CSRF Prevention on the Platform.
    • Request Body (this example includes the optional website address, but you can delete that value, keeping the line with an empty value):
      {
        "Name":"MyAppName",
        "Description":"MyAppDescription",
        "ApplicationVersion":{
          "Name":"MyAppVersionName",
          "Description":"MyAppVersionDescription",
          "Tag":[
          ],
          "InitialEnvironment":"Sandbox",
          "Visibility":"Public",
          "WebsiteAddress":"www.mywebsiteaddress.com"
        }
      }
  3. Take the AppID returned in the response; you will use it later.
  4. Repeat steps 2-3 as needed to add subsequent apps.
  5. When done, remember to log out using the POST /api/login/logout operation. Use the following values:
    • URL: https://{hostname}/api/login/logout
    • Accept header: application/json
    • Content-Type header: application/x-www-form-urlencoded

Back to top

Related Topics