Replace Application by ID
post
/iot/api/v2/apps/{app-id}
Replace application details with provided partial or complete application definition, by given application ID.
Request
Supported Media Types
- application/json
Path Parameters
-
app-id: string
Application id to be patched
Header Parameters
-
X-HTTP-Method-Override: string
To perform a partial update of the application, POST request should be orchestrated with method override set to PATCH
Response
Supported Media Types
- application/json
- application/vnd.oracle.resource+json;type=singular
200 Response
Successfully processed.
400 Response
Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
401 Response
Unauthorized. The request requires user authentication.
404 Response
Not Found. The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
405 Response
Method Not Allowed. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
406 Response
Request Not Acceptable. The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
415 Response
Unsupported Media Type. The request entity has a media type which the server or resource does not support.
Examples
curl -X POST
-u <username>:<password>
-H 'Content-Type: application/json'
--header "X-HTTP-Method-Override: PATCH"
http://iotserver/iot/api/v2/apps/{app-id}
Example of Request Body
The following example shows the content of the request body in JSON format
{
"integrationIds":[
"integrationIds_1",
"integrationIds_2",
"integrationIds_3"
],
"metadata":{
"metadata_key1":"metadata_value1",
"metadata_key2":"metadata_value2",
"metadata_key3":"metadata_value3"
},
"deviceModels":[
{
"urn":"urn:example:unique:identifier:of:the:resource:5755",
"formats":[
{
"urn":"urn:example:unique:identifier:of:the:resource:110d",
"name":"Message format name",
"description":"Message format description",
"deviceModel":"Device model that created this message format",
"type":"DATA",
"value":{
"fields":[
{
"name":"Name of the message format field",
"optional":false,
"type":"STRING"
}
]
}
}
],
"name":"Human friendly name of the device model",
"description":"Optional description of the device model",
"attributes":[
{
"name":"A name for the attribute",
"description":"A human friendly description",
"alias":"Optional alternative name",
"range":"For NUMBERs and INTEGERs only, defines the acceptable range of values such as '1,10'. This range is inclusive.",
"type":"STRING",
"writable":false
}
],
"actions":[
{
"name":"A name for the action",
"argType":"STRING",
"description":"A human friendly description",
"alias":"Optional alternative name",
"range":"For NUMBERs and INTEGERs only, defines the acceptable range of values such as '1,10'. This range is inclusive."
}
]
}
],
"description":"IoT Application description",
"deviceModelURNs":[
"deviceModelURNs_1",
"deviceModelURNs_2",
"deviceModelURNs_3"
],
"type":"IoT Application type",
"fences":[
{
"3DFence":false,
"createdAsString":"2016-07-22T10:44:57.746Z",
"geoJSON":{
"crs":{
"type":"name",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
}
},
"bbox":[
"bbox_1",
"bbox_2",
"bbox_3"
],
"geometry":{
"crs":{
"type":"name",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
}
},
"bbox":[
"bbox_1",
"bbox_2",
"bbox_3"
]
},
"id":"e12699055de-1164",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
}
},
"lastModifiedAsString":"2016-07-22T10:44:57.746Z",
"altitudeRange":[
"altitudeRange_1",
"altitudeRange_2",
"altitudeRange_3"
],
"name":"Human friendly name of the GeoFence",
"id":"40cd458f4c00-16f0",
"applicationId":"5ee98345636-4110",
"enabled":false,
"tags":[
"tags_1",
"tags_2",
"tags_3"
]
}
],
"name":"IoT Application name",
"iacsServiceNames":[
"iacsServiceNames_1",
"iacsServiceNames_2",
"iacsServiceNames_3"
],
"id":"314613897b5b-7c41"
}
Example of Response Body
The following example shows the content of the response body in JSON format
{
"exported":1469184297746,
"metadata":{
"metadata_key1":"metadata_value1",
"metadata_key2":"metadata_value2",
"metadata_key3":"metadata_value3"
},
"createdAsString":"2016-07-22T10:44:57.746Z",
"deviceModels":[
{
"formats":[
{
"urn":"urn:example:unique:identifier:of:the:resource:3733",
"name":"Message format name",
"description":"Message format description",
"deviceModel":"Device model that created this message format",
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"type":"DATA",
"value":{
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"fields":[
{
"name":"Name of the message format field",
"optional":false,
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"type":"STRING"
}
]
}
}
],
"createdAsString":"2016-07-22T10:44:57.746Z",
"created":1469184297746,
"description":"Optional description of the device model",
"userLastModified":"Name of the user who last to modify this device model",
"urn":"urn:example:unique:identifier:of:the:resource:4111",
"system":false,
"lastModifiedAsString":"2016-07-22T10:44:57.746Z",
"draft":false,
"name":"Human friendly name of the device model",
"attributes":[
{
"name":"A name for the attribute",
"description":"A human friendly description",
"alias":"Optional alternative name",
"range":"For NUMBERs and INTEGERs only, defines the acceptable range of values such as '1,10'. This range is inclusive.",
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"type":"STRING",
"writable":false
}
],
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"lastModified":1469184297746,
"actions":[
{
"name":"A name for the action",
"argType":"STRING",
"description":"A human friendly description",
"alias":"Optional alternative name",
"range":"For NUMBERs and INTEGERs only, defines the acceptable range of values such as '1,10'. This range is inclusive.",
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
]
}
]
}
],
"created":1469184297746,
"description":"IoT Application description",
"userLastModified":"Name of the user performed last application update",
"type":"IoT Application type",
"exportedFrom":"Application instance export source",
"fences":[
{
"createdAsString":"2016-07-22T10:44:57.746Z",
"geoJSON":{
"crs":{
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"type":"name",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
}
},
"bbox":[
"bbox_1",
"bbox_2",
"bbox_3"
],
"geometry":{
"crs":{
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"type":"name",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
}
},
"bbox":[
"bbox_1",
"bbox_2",
"bbox_3"
],
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
]
},
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"id":"7df964bef7c-2486",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
}
},
"lastModifiedAsString":"2016-07-22T10:44:57.746Z",
"created":1469184297746,
"name":"Human friendly name of the GeoFence",
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"id":"5c3cc30637e-5130",
"lastModified":1469184297746,
"applicationId":"41983a385050-3c92",
"enabled":false,
"tags":[
"tags_1",
"tags_2",
"tags_3"
]
}
],
"lastModifiedAsString":"2016-07-22T10:44:57.746Z",
"exportedAsString":"2016-07-22T10:44:57.746Z",
"name":"IoT Application name",
"iacsServiceNames":[
"iacsServiceNames_1",
"iacsServiceNames_2",
"iacsServiceNames_3"
],
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"id":"5fbb56b55121-79be",
"lastModified":1469184297746
}
Complete cURL Example
The following example shows compete cURL comand that can be used to perform described operation
curl -X POST
-u <username>:<password>
-H 'Content-Type: application/json'
--header "X-HTTP-Method-Override: PATCH"
-d '{"integrationIds":["integrationIds_1","integrationIds_2","integrationIds_3"],"metadata":{"metadata_key1":"metadata_value1","metadata_key2":"metadata_value2","metadata_key3":"metadata_value3"},"deviceModels":[{"urn":"urn:example:unique:identifier:of:the:resource:5755","formats":[{"urn":"urn:example:unique:identifier:of:the:resource:110d","name":"Message format name","description":"Message format description","deviceModel":"Device model that created this message format","type":"DATA","value":{"fields":[{"name":"Name of the message format field","optional":false,"type":"STRING"}]}}],"name":"Human friendly name of the device model","description":"Optional description of the device model","attributes":[{"name":"A name for the attribute","description":"A human friendly description","alias":"Optional alternative name","range":"For NUMBERs and INTEGERs only, defines the acceptable range of values such as '1,10'. This range is inclusive.","type":"STRING","writable":false}],"actions":[{"name":"A name for the action","argType":"STRING","description":"A human friendly description","alias":"Optional alternative name","range":"For NUMBERs and INTEGERs only, defines the acceptable range of values such as '1,10'. This range is inclusive."}]}],"description":"IoT Application description","deviceModelURNs":["deviceModelURNs_1","deviceModelURNs_2","deviceModelURNs_3"],"type":"IoT Application type","fences":[{"3DFence":false,"createdAsString":"2016-07-22T10:44:57.746Z","geoJSON":{"crs":{"type":"name","properties":{"properties_key1":"properties_value1","properties_key2":"properties_value2","properties_key3":"properties_value3"}},"bbox":["bbox_1","bbox_2","bbox_3"],"geometry":{"crs":{"type":"name","properties":{"properties_key1":"properties_value1","properties_key2":"properties_value2","properties_key3":"properties_value3"}},"bbox":["bbox_1","bbox_2","bbox_3"]},"id":"e12699055de-1164","properties":{"properties_key1":"properties_value1","properties_key2":"properties_value2","properties_key3":"properties_value3"}},"lastModifiedAsString":"2016-07-22T10:44:57.746Z","altitudeRange":["altitudeRange_1","altitudeRange_2","altitudeRange_3"],"name":"Human friendly name of the GeoFence","id":"40cd458f4c00-16f0","applicationId":"5ee98345636-4110","enabled":false,"tags":["tags_1","tags_2","tags_3"]}],"name":"IoT Application name","iacsServiceNames":["iacsServiceNames_1","iacsServiceNames_2","iacsServiceNames_3"],"id":"314613897b5b-7c41"}'
http://iotserver/iot/api/v2/apps/4f4653162f14-25f6
Note that in the request, http://iotserver will be replaced by the name and port of your assigned IoT Cloud Service instance. The format of the Cloud Service instance is https:// myinstance-myidentitydomain.iot.us.oraclecloud.com and the default port is 443.