POST /api/apps/{AppID}/versions

Adds a version of an app. Can be either the original version when the app is created, or a new version created later.

When a new app is created, this method should be invoked immediately following successful completion of the POST /api/apps method.

Note: When you add a new app or a new app version, if the platform includes APIs that are set to automatically create contracts, a contract is automatically created with your new app/app version.

Authorization Roles/Permissions: Must be logged in. App team member, Business Admin. When a user invokes this method to create an app, successful completion of the operation gives the user a role as team member. When the current operation, POST /api/apps/{AppID}/versions, is invoked, which should immediately follow successful completion of POST /api/apps, the user already has the required team membership as assigned by the POST /api/apps operation.

Workflow: There is no default workflow for new app versions. However, a custom workflow might be in place. There is only one initial action valid for Akana API Platform workflows relating to app versions, the @Create initial action. For more information on workflow, see Executing Workflow Actions.

Authorization token renewal: This operation changes information that is reflected in the authorization token; therefore, when invoking this operation, you must also renew the token.

This topic includes the following sections:

HTTP Method

POST

URL

https://{hostname}/api/apps/{AppID}/versions

Sample Request

The example below sends information about the initial version of a crossword puzzle app.

Sample Request URL

https://{hostname}/api/apps/app10037.acmepaymentscorp/versions

Sample request headers

POST /api/apps/app10037.acmepaymentscorp/versions HTTP/1.1
Host:{hostname}
Accept: */*
Content-Type: application/json; charset=UTF-8
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body #1

Includes optional tags and description.

{
  "Name":"1.0",
  "Description":"1.0",
  "Tag":[
    "Puzzle",
    "crossword",
    "game",
    "Android"
  ],
  "AppID":"app10037.acmepaymentscorp",
  "InitialEnvironment":"Sandbox",
  "Visibility":"Public",
  "WebsiteAddress":""
}

Sample request body #2

Includes the minimum content needed to add a new app version; the Name field, which corresponds to the Version ID field in the Community Manager developer portal user interface.

{
  "Name":"Version 2"
}

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept Any Accept header value that supports a response Content-Type of text/plain is valid; for example, */*.
Content-Type

Any one of the following media types is valid for the request Content-Type:

application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json

Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
AppID Path string Required The unique ID for a specific app.
ApplicationVersion Body ApplicationVersion Required

Information about the app version, such as name, description, and tags.

At minimum, the content must include a value for the Name field.

Response

If successful, this operation returns HTTP status code 200, with the AppVersionID of the app version in plain text.

Sample Response

The sample response below shows the AppVersionID of the app version in plain text.

Sample response headers

HTTP/1.1 200 OK
Date: Wed, 19 Sep 2012 16:03:19 GMT
Content-Type: text/plain
Atmo-Renew-Token: renew

Sample response body

72zNE5InKlf2z00y8fWSp3AU.acmepaymentscorp

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type text/plain
Atmo-Renew-Token renew

Response Body

Name Type Description
AppVersionID string The unique ID for a specific app version.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.