Lookup Asset ID
get
/mobile/tools/1.0/assets/lookup
Returns the ID of the asset that's identified by its name and version.
Request
Supported Media Types
- application/json
Query Parameters
-
fqn: string
Full name and version of the asset in the format
namespace/name(version)
for APIs and connectors, andname(version)
for other asset types. -
type: string
The asset's type.Allowed Values:
[ "API", "MobileBackend", "Connector", "APIImplementation", "Client", "StorageCollection", "Package" ]
Response
Supported Media Types
- application/json
200 Response
Asset metadata.
Headers
-
ETag: string
The ETag corresponds to the state of the asset (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.
Asset information (short form).
Root Schema : assetShort
Type:
object
Asset information (short form).
Show Source
-
id(optional):
string
Asset identifier.
-
name(optional):
string
Asset name.
-
namespace(optional):
string
Asset namespace.
-
version(optional):
string
Maximum Length:
100
Pattern:^[a-zA-Z0-9][\w.]*$
Asset version.
404 Response
An asset with the specified name and version doesn't exist.
Root Schema : error
Type:
Show Source
object
-
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
The service's error code.
-
o:errorDetails(optional):
object errorDetails
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer(int64)
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.
Nested Schema : errorDetails
Type:
Show Source
object
-
detail:
string
-
o:errorDetails(optional):
object errorDetails
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
Examples
This example shows how to get the ID of an asset that's identified by its name and version. It gets the ID of the asset that's of type API
, is in the custom
namespace, is version 1.0
, and is named incidentreport
.
curl -i -X GET -H "Authorization: Bearer $TOKEN" \
"$BASE_URL/mobile/tools/1.0/assets/lookup?type=API&fqn=custom/incidentreport(1.0)"
Example of Response Header
Here's an example of the response headers.
200 OK
Content-Length: 85
Content-Type: application/json
Date: Tue, 10 Jul 2018 00:46:31 GMT
Example of Response Body
Here's the contents of the response body.
{
"id": "ce6b3adb-4c8d-47d7-98ab-95b15f2db00f",
"name": "incidentreport",
"version": "1.0"
}