Upload Custom API Implementation
/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
- multipart/form-data
-
id: string
The unique ID for the custom API. For example,
b11b9844-d4e2-4da9-a0f9-f0a8a68ac9f8.
-
file: file
The ZIP file that contains all the artifacts for the custom API implementation.
Response
- application/json
201 Response
-
ETag: integer
The ETag value is always 1.
objectImplementation Artifact Details-
artifactId:
string
An MCS-generated unique identifier for the uploaded ZIP file.
-
implementationId:
string
An MCS-generated unique identifier for the custom API implementation.
-
unresolvedDependencies(optional):
array Unresolved Dependencies
Title:
Unresolved DependenciesMinimum Number of Items:0Unique Items Required:trueArray of unresolved dependencies for the custom API implementation.
arrayUnresolved Dependencies0true-
Array of:
object Unresolved Dependency
Title:
Unresolved DependencyA custom API or connector that's declared as a dependency in thepackage.jsonfile but doesn't exist in MCS.
objectUnresolved Dependencypackage.json file but doesn't exist in MCS.-
name:
string
The name of the custom API or connector.
-
version:
string
The version of the custom API or connector.
{
"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.
objectError-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorDetails(optional):
array o:errorDetails
Minimum Number of Items:
0List of the issues that cause the error. Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array0-
Array of:
object Error Detail
Title:
Error Detail
objectError Detail-
instance:
string
The URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
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.
objectError-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorDetails(optional):
array o:errorDetails
Minimum Number of Items:
0List of the issues that cause the error. Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array0-
Array of:
object Error Detail
Title:
Error Detail
objectError Detail-
instance:
string
The URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
403 Response
Bad OAuth request, such as wrong consumer key, bad nonce, or expired timestamp. Unfortunately, re-authenticating the user won't help here.
objectError-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorDetails(optional):
array o:errorDetails
Minimum Number of Items:
0List of the issues that cause the error. Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array0-
Array of:
object Error Detail
Title:
Error Detail
objectError Detail-
instance:
string
The URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
404 Response
A Custom API doesn't exist for ID in the id path parameter.
objectError-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorDetails(optional):
array o:errorDetails
Minimum Number of Items:
0List of the issues that cause the error. Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array0-
Array of:
object Error Detail
Title:
Error Detail
objectError Detail-
instance:
string
The URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
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": []
}