Upload Custom API Implementation

post

/mobile/tools/1.0/apis/{id}/implementations

Creates or updates a version of a custom API implementation using the ZIP file provided in the request.

Permissions

To access this operation, you must be a team member with the MobileEnvironment_Develop role.

Request

Supported Media Types
Path Parameters
  • The unique ID for the custom API. For example, b11b9844-d4e2-4da9-a0f9-f0a8a68ac9f8.

Form Parameters
  • The ZIP file that contains all the artifacts for the custom API implementation.
Back to Top

Response

Supported Media Types

201 Response

Implementation ZIP file uploaded successfully.
Headers
Body ()
Root Schema : Implementation Artifact Details
Type: object
Title: Implementation Artifact Details
The artifact details for the uploaded implementation.
Show Source
Nested Schema : Unresolved Dependencies
Type: array
Title: Unresolved Dependencies
Minimum Number of Items: 0
Unique Items Required: true
Array of unresolved dependencies for the custom API implementation.
Show Source
Nested Schema : Unresolved Dependency
Type: object
Title: Unresolved Dependency
A custom API or connector that's declared as a dependency in the package.json file but doesn't exist in MCS.
Show Source
Example Response (application/json)
{
    "implementationId":"17a5b053-4d99-4dcf-8cc7-4b7feb152ce4",
    "artifactId":"7da44b1a-b3e0-4d2f-b696-ac7444fbdd68",
    "unresolvedDependencies":[
        {
            "name":"custom/employees",
            "version":"3.5.1"
        },
        {
            "name":"connector/hcm",
            "version":"1.0"
        }
    ]
}

400 Response

There's an issue with the ZIP file. For example, MCS can't unzip the file or it can't find the main JavaScript file.

Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by Mobile Cloud Service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source

401 Response

Bad or expired token. This can happen if the user or MCS revoked or expired an access token. You must re-authenticate the user.

Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by Mobile Cloud Service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source

403 Response

Bad OAuth request, such as wrong consumer key, bad nonce, or expired timestamp. Unfortunately, re-authenticating the user won't help here.

Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by Mobile Cloud Service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source

404 Response

A Custom API doesn't exist for ID in the id path parameter.

Body ()
Root Schema : Error
Type: object
Title: Error
The error JSON object returned by Mobile Cloud Service.
Show Source
Nested Schema : o:errorDetails
Type: array
Minimum Number of Items: 0
List of the issues that cause the error. Included when the error is caused by multiple issues.
Show Source
Nested Schema : Error Detail
Type: object
Title: Error Detail
Show Source
Back to Top

Examples

The following example shows how to upload a custom API implementation ZIP file by submitting a POST request on the REST resource using cURL. Note that you must use OAuth authorization for this API. For more information about cURL, see Use cURL.

curl -i
-X POST
-F file=@myCustomAPI.zip
-H "Authorization: Bearer ${OAUTH_TOKEN}"
https://fif.cloud.oracle.com/mobile/tools/1.0/apis/b11b9844-d4e2-4da9-a0f9-f0a8a68ac9f8/implementations

Example of Response Header

The following shows an example of the response header:

201 CREATED
Content-Type: application/json
Date: Mon, 23 Jan 2017 18:37:58 GMT
ETag: 1

Example of Response Body

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

{
  "implementationId": "2a60feb3-aaa9-4210-8d18-3ac62d818c19",
  "artifactId": "413ae322-1d50-4431-8709-84ebf7db4301",
  "unresolvedDependencies": []
}
Back to Top