Create or update floor plan
post
/assetMonitoring/clientapi/v2/places/{place-name}/floorplan
This resource allows to create or update floor plan on Oracle IoT Cloud Service. This non-org aware REST API will be deprecated in future releases.
Request
Supported Media Types
- multipart/form-data
Path Parameters
-
place-name: string
Entity description is undefined
Header Parameters
-
X-HTTP-Method-Override: string
To perform a partial update of the floor plan, POST request should be orchestrated with method override set to PATCH
Root Schema : FloorPlanImpl_update
Type:
Show Source
object
-
description(optional):
string
A human friendly description
-
imageFileName(optional):
string
Property description was not set
-
name(optional):
string
Floor plan name
-
referencePoints(optional):
object FloorPlanReferencePoints_update
Nested Schema : FloorPlanReferencePoints_update
Type:
Show Source
object
-
imageP1(optional):
string
Property description was not set
-
imageP2(optional):
string
Property description was not set
-
mapP1(optional):
string
Property description was not set
-
mapP2(optional):
string
Property description was not set
Response
Supported Media Types
- application/json
202 Response
Successfully processed.
Root Schema : FloorPlanImpl_receive
Type:
Show Source
object
-
description:
string
A human friendly description
-
id:
string
Floor plan unique id
-
image:
object image
Base64 encoded string corresponding to the floor plan image
-
name:
string
Floor plan name
-
referencePoints:
object FloorPlanReferencePoints_receive
Nested Schema : image
Type:
object
Base64 encoded string corresponding to the floor plan image
Show Source
-
links(optional):
array links
The set of API navigation links.
Nested Schema : FloorPlanReferencePoints_receive
Type:
Show Source
object
-
imageP1:
string
Property description was not set
-
imageP2:
string
Property description was not set
-
mapP1:
string
Property description was not set
-
mapP2:
string
Property description was not set
Nested Schema : items
Type:
Show Source
object
-
href(optional):
string
The target resource URIExample:
https://iotserver/iot/api/vX/some/API/path
-
rel(optional):
string
Relation typeExample:
canonical
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.
403 Response
Forbidden. The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated.
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 'Accept: application/json'
--header "X-HTTP-Method-Override: PATCH"
https://iotserver/assetMonitoring/clientapi/v2/places/{place-name}/floorplan
Example of Request Body
The following example shows the content of the request body in JSON format:
{
"name":"Floor plan name",
"description":"A human friendly description",
"referencePoints":{
"imageP1":"Coordinates of the first point on image",
"imageP2":"Coordinates of the second point on image",
"mapP1":"Geographic coordinates of the first point",
"mapP2":"Geographic coordinates of the second point"
},
"imageFileName":"Property description was not set"
}
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"id":"57197e2c779b-c0b",
"name":"Floor plan name",
"description":"A human friendly description",
"image":{
"links":[
{
"rel":"self",
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path"
},
{
"rel":"canonical",
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path"
}
]
},
"referencePoints":{
"imageP1":"Coordinates of the first point on image",
"imageP2":"Coordinates of the second point on image",
"mapP1":"Geographic coordinates of the first point",
"mapP2":"Geographic coordinates of the second point"
}
}
Complete cURL Example
The following example shows a complete cURL command that you can use to perform the described operation:
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
--header "X-HTTP-Method-Override: PATCH"
-d '{"name":"Floor plan name","description":"A human friendly description","referencePoints":{"imageP1":"Coordinates of the first point on image","imageP2":"Coordinates of the second point on image","mapP1":"Geographic coordinates of the first point","mapP2":"Geographic coordinates of the second point"},"imageFileName":"Property description was not set"}'
https://iotserver/assetMonitoring/clientapi/v2/places/{place-name}/floorplan
Note that in the request,
https://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.