POST /api/apps

Creates a new app, which includes the first app version. The response includes information about the new app and app version.

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. User

Workflow: There is no default workflow for new apps. However, a custom workflow might be in place. There is only one initial action valid for Akana API Platform workflows relating to apps, 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

Sample Request

The example below adds a crossword puzzle app.

Sample request URL

https://{hostname}/api/apps

Sample request headers

POST /api/apps HTTP/1.1
Host: {hostname}
Accept: application/vnd.soa.v84+json
Content-Type: application/vnd.soa.v84+json
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body #1

In this example, the app is not added in the context of a specific business organization. For the response, see Sample request body #1.

{
  "Name":"Crosfhocal",
  "Summary":"Crossword puzzle app",
  "Description":"Crossword puzzle app for Android phones and iPhones",
  "ApplicationVersion":{
    "Name":"1.0",
    "Description":"Initial version",
    "Tag":[
      "puzzle",
      "language",
      "learning",
      "iPhone",
      "Android"
    ],
    "Visibility":"Public",
    "Identity":"",
    "SharedSecret":"",
    "WebsiteAddress":"http://www.acmepaymentscorp.com/crosfhocal"
  },
  "PictureID":""
}

Sample request body #2

Adds an app in the context of the business organization specified in the BusinessID property. For the response, see Sample request body #2.

{
  "Name":"Crosfhocal2",
  "Summary":"Crossword puzzle app",
  "Description":"Crossword puzzle app for Android phones and iPhones",
  "ApplicationVersion":{
    "Name":"1.0",
    "Description":"Initial version",
    "Tag":[
      "puzzle",
      "language",
      "learning",
      "iPhone",
      "Android"
    ],
    "Visibility":"Public",
    "Identity":"",
    "SharedSecret":"",
    "WebsiteAddress":"http://www.acmepaymentscorp.com/crosfhocal"
  },
  "PictureID":"",
  "BusinessID":"eff794d5-5fa7-4e78-aee2-dc5ab75579bd.acmepaymentscorp"
}

Request Headers

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

Header Description
Accept application/json, application/vnd.soa.v84+json
Content-Type application/vnd.soa.v84+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
Application Body Application Required Information about the app, and initial app version, being added.

Response

If successful, this operation returns HTTP status code 200, with information about the new app, and the first app version, in JSON format.

Sample Response

The sample response includes all the information about the new app and app version.

Sample response headers

Content-Type: application/vnd.soa.v84+json
Date: Thu, 28 Dec 2017 20:27:15 GMT
atmo-renew-token: renew

Sample response body #1

Returns information about the app in response to the request in Sample request body #1 above. The app is not associated with a specific business organization.

{
  "AppID":"665cda60-a6ae-452d-acb9-511f1b418de4.acmepaymentscorp",
  "Name":"Crosfhocal",
  "Description":"Crossword puzzle app for Android phones and iPhones",
  "Summary":"Crossword puzzle app",
  "Visibility":"Public",
  "Tag":[
  ],
  "ApplicationVersion":{
    "RuntimeID":"UFdbpXIHYD1hVUMfcTGnCDSGs9J84AF13Rc7gSoq.acmepaymentscorp",
    "AppID":"665cda60-a6ae-452d-acb9-511f1b418de4.acmepaymentscorp",
    "Name":"1.0",
    "Description":"Initial version",
    "WebsiteAddress":"http://www.acmepaymentscorp.com/crosfhocal",
    "Visibility":"Public",
    "InitialEnvironment":"Sandbox",
    "CurrentEnvironment":"Sandbox",
    "Tag":[
      "puzzle",
      "language",
      "learning",
      "iPhone",
      "Android"
    ],
    "SecurityMechanisms":[
    ],
    "Identity":"acmepaymentscorp-UFdbpXIHYD1hVUMfcTGnCDSGs9J84AF13Rc7gSoq",
    "SharedSecret":""
  }
}

Sample response body #2

Returns information about the app in response to the request in Sample request body #2 above. The app is associated with the business organization specified in the last property, BusinessID.

{
    "AppID": "5e71027d-bccb-45b7-9528-a698f8dea1bf.acmepaymentscorp",
    "Name": "Crosfhocal2",
    "Description": "Crossword puzzle app for Android phones and iPhones",
    "Summary": "Crossword puzzle app",
    "Visibility": "Public",
    "Tag": [],
    "ApplicationVersion": {
        "RuntimeID": "IcZlqjQVTFhBSlUNpL11sil85yvuCQ5PNJ77RgfW.acmepaymentscorp",
        "AppID": "5e71027d-bccb-45b7-9528-a698f8dea1bf.acmepaymentscorp",
        "Name": "1.0",
        "Description": "Initial version",
        "WebsiteAddress": "http://www.acmepaymentscorp.com/crosfhocal",
        "Visibility": "Public",
        "InitialEnvironment": "Sandbox",
        "CurrentEnvironment": "Sandbox",
        "Tag": [
            "puzzle",
            "language",
            "learning",
            "iPhone",
            "Android"
        ],
        "SecurityMechanisms": [],
        "Identity": "acmepaymentscorp-IcZlqjQVTFhBSlUNpL11sil85yvuCQ5PNJ77RgfW",
        "SharedSecret": ""
    },
    "BusinessID": "eff794d5-5fa7-4e78-aee2-dc5ab75579bd.acmepaymentscorp"
}

Response Headers

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

Header Description
Content-Type application/json, application/vnd.soa.v84+json
Atmo-Renew-Token renew

Response Body

Name Type Description
Application Application Information about the app that was added, including information about the initial 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.