Add Backend

post

/mobile/tools/1.0/mobilebackends

Creates a backend. You use backends to access the service.

Request

Supported Media Types
  • application/json
Body Parameter
The backend representation for POST requests.
Root Schema : mobilebackendCreate
Type: object
The backend representation for POST requests.
Nested Schema : assetCreate
Type: object
The asset representation for POST requests.
Nested Schema : mobilebackendCreate-allOf[1]
Nested Schema : assetUpdate
Type: object
The asset representation for PUT requests.
Nested Schema : assetCreate-allOf[1]
Nested Schema : mobilebackendRoleAccess
Type: object
The backend's role-access details.
Nested Schema : stringArray
Type: array
Minimum Number of Items: 0
An array of string values.

Response

Supported Media Types
  • application/json
201 Response
The backend was created, and the metadata for the new backend was returned.
Headers
ETag
Type: string
The ETag corresponds to the state of the backend (that is, the value increments by one on each change operation). You can use this ETag with the `If-Match` HTTP header on a request.
Location
Type: string
URL to get the details about the new backend.
Body
The backend representation for GET requests.
Root Schema : mobilebackendGet
Type: object
The backend representation for GET requests.
Nested Schema : mobilebackendShortGet
Type: object
The backend representation for GET requests.
Nested Schema : mobilebackendGet-allOf[1]
Nested Schema : assetGet
Type: object
The asset representation for GET requests.
Nested Schema : mobilebackendOAuthKeys
Type: object
The client keys (client_id/client_secret) that are required for backend access using OAuth.
Nested Schema : mobilebackendBasicAuthKeys
Type: object
The mobile backend ID that's required for backend access when you use Basic access authorization.
Nested Schema : mobilebackendShortGet-allOf[3]
Nested Schema : assetUpdate
Type: object
The asset representation for PUT requests.
Nested Schema : assetIdEtag
Type: object
The asset ID and entity tag (ETag) values.
Nested Schema : trash
Type: object
Indicator of whether the asset is in the trash.
Nested Schema : assetGet-allOf[3]
Nested Schema : entityLinksArray
Type: array
Minimum Number of Items: 0
An array of links for an entity's metadata.
Nested Schema : items
Type: object
Link to the entity's metadata.
Nested Schema : mobilebackendRoleAccess
Type: object
The backend's role-access details.
Nested Schema : stringArray
Type: array
Minimum Number of Items: 0
An array of string values.
Nested Schema : assetShort
Type: object
Asset information (short form).
Nested Schema : localizedMessage
Type: object
Localized error message for generic purposes.
Nested Schema : params
Type: array
Minimum Number of Items: 0
400 Response
The backend specification is missing.
Body
Root Schema : error
Type: object
Nested Schema : errorDetails
Type: object
409 Response
A backend with the same name and version already exists.
Body
Root Schema : error
Type: object
Nested Schema : errorDetails
Type: object
500 Response
Something unpredictable has happened. See the error details.
Body
Root Schema : error
Type: object
Nested Schema : errorDetails
Type: object

Examples

The following example shows how to add a backend using cURL. For more information about cURL, see Use cURL.

curl -i -X POST -d @body.json -H "Content-Type: application/json; charset=utf-8" -H "Authorization: Bearer $TOKEN" "$BASE_URL/mobile/tools/1.0/mobilebackends"

Example of Request Body

The following shows an example of the request body.

{
    "name": "motd",
    "version": "1.0",
    "desc": "Message of the Day"
}

Example of Response Header

The following shows an example of the response headers:

201 CREATED
Content-Length: 2468
Content-Type: application/json
Date: Thu, 05 Oct 2017 01:37:21 GMT
Etag: "1"
Location: http://myURL/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560

Example of Response Body

The following example shows the contents of the response body in JSON format:

{
    "id": "e7fabea8-7fa8-44c0-b52b-96b488df9560",
    "name": "motd",
    "version": "1.0",
    "desc": "Message of the Day",
    "links": [
        {
            "rel": "canonical",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560"
        },
        {
            "rel": "purgeDependencies",
            "href": "/mobile/tools/1.0/assets/purgeDependencies"
        },
        {
            "rel": "purging",
            "href": "/mobile/tools/1.0/assets/purging"
        },
        {
            "rel": "trashDependencies",
            "href": "/mobile/tools/1.0/assets/trashDependencies"
        },
        {
            "rel": "trashing",
            "href": "/mobile/tools/1.0/assets/trashing"
        },
        {
            "rel": "untrashDependencies",
            "href": "/mobile/tools/1.0/assets/untrashDependencies"
        },
        {
            "rel": "untrashing",
            "href": "/mobile/tools/1.0/assets/untrashing"
        },
        {
            "rel": "dependencies",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/dependencies"
        },
        {
            "rel": "history",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/history"
        },
        {
            "rel": "publication",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/publication"
        },
        {
            "rel": "reverseDependencies",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/reverseDependencies"
        },
        {
            "rel": "notifications",
            "href": "/mobile/tools/1.0/notifications/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/notifications"
        },
        {
            "rel": "apis",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/apis"
        },
        {
            "rel": "collections",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/collections"
        },
        {
            "rel": "basicAuthentication",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/security/basic"
        },
        {
            "rel": "basicAuthenticationKeys",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/security/basic/keys"
        },
        {
            "rel": "identityProviders",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/security/identityproviders"
        },
        {
            "rel": "oauthKeys",
            "href": "/mobile/tools/1.0/mobilebackends/e7fabea8-7fa8-44c0-b52b-96b488df9560/security/oauth/keys"
        },
        {
            "rel": "self",
            "href": "/mobile/tools/1.0/mobilebackends/"
        }
    ],
    "published": false,
    "inTrash": false,
    "actionComment": null,
    "etag": "1",
    "createdOn": "2017-10-05T01:37:25.265Z",
    "modifiedOn": "2017-10-05T01:37:25.265Z",
    "modifiedBy": "jdoe",
    "deletedOn": null,
    "deletedBy": null,
    "clientId": "addd5fb618d84c44b6d1d4d4256a7c2e",
    "clientSecret": "5a7ddd27-0e5e-4f1f-825b-8e4c5dff06b8",
    "basicAuthBackendId": "9e76b8a0-cf54-4bfd-8cd7-6dc4b52e576e",
    "oauth": true,
    "basicAuth": true,
    "inactive": false,
    "roleAccess": {
        "enabled": false,
        "roles": []
    }
}