Example: Adding an App Version

This example walks you through adding a new version to an existing app in Akana API Platform by using the API rather than the user interface.

This exercise assumes that you already have a valid login for Akana API Platform and are a member of the app team. You can't add an app version unless you're an authorized user. Before running the procedures below, get set up as a platform user, and get another member of the app team to invite you to the team.

Note: If you added the app, you automatically become the first member of the app team. See Example: Adding an App.

Before starting, you will need:

  • A valid UserID and password for platform access.
  • The AppID.

To add an app version 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
    • Request Body:
      {
        "email":"MyEmailAddress",
        "password":"MyPassword"
      }

    The platform API returns the login cookie, which you'll need to send with the request headers for any operation that requires login, and the CSRF cookie, which you'll need to use to put together the CSRF header if required by platform settings (not covered in this exercise: see Example: Using the CSRF header).

  2. Add the app version, using the POST /api/apps/{AppID}/versions operation. In your API call, use the following, substituting the correct AppID in the URL and also in the request body:
    • HTTP method: POST
    • URL: https://{hostname}/api/apps/{AppID}/versions
    • 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 optional tags, but you can just omit those two lines, keeping the opening and closing square brackets):
      {
        "Visibility":"Public",
        "SharedSecret":"",
        "Name":"v2",
        "Description":"Updated app version with additional features",
        "Tag":[
          
        ],
        "WebsiteAddress":"",
        "AppID":"{AppID}"
      }
  3. When done, remember to log out using the GET /api/login/endsession operation. Use the following values:
    • URL: https://{hostname}/api/login/endsession
    • Accept header: application/json