cURL Python JavaScript Java
bash curl --request POST \
--url ' https://api2.rhombussystems.com/api/robot/updateDetails ' \
--header ' x-auth-scheme: api-token ' \
--header ' x-auth-apikey: YOUR_API_KEY ' \
--header ' Content-Type: application/json ' \
--data ' {
"description": "Patrols the lobby.",
"deviceUuid": "AAAAAAAAAAAAAAAAAAAAAA",
"latitude": 37.7749,
"locationUuid": "AAAAAAAAAAAAAAAAAAAAAA",
"longitude": -122.4194,
"name": "Robocop",
"subLocationsHierarchyKey": "AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA",
"subLocationsHierarchyKeyUpdated": false
} ' import requests
url = " https://api2.rhombussystems.com/api/robot/updateDetails "
headers = {
" x-auth-scheme ": " api-token ",
" x-auth-apikey ": " YOUR_API_KEY ",
" Content-Type ": " application/json ",
}
payload = {
" description ": " Patrols the lobby. ",
" deviceUuid ": " AAAAAAAAAAAAAAAAAAAAAA ",
" latitude ": 37.7749 ,
" locationUuid ": " AAAAAAAAAAAAAAAAAAAAAA ",
" longitude ": - 122.4194 ,
" name ": " Robocop ",
" subLocationsHierarchyKey ": " AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA ",
" subLocationsHierarchyKeyUpdated ": False
}
response = requests. post ( url , headers= headers , json= payload )
response. raise_for_status ()
print ( response . json ()) const response = await fetch (' https://api2.rhombussystems.com/api/robot/updateDetails ', {
method : ' POST ',
headers : {
' x-auth-scheme ': ' api-token ',
' x-auth-apikey ': ' YOUR_API_KEY ',
' Content-Type ': ' application/json ',
},
body : JSON. stringify ({
" description ": " Patrols the lobby. ",
" deviceUuid ": " AAAAAAAAAAAAAAAAAAAAAA ",
" latitude ": 37.7749 ,
" locationUuid ": " AAAAAAAAAAAAAAAAAAAAAA ",
" longitude ": - 122.4194 ,
" name ": " Robocop ",
" subLocationsHierarchyKey ": " AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA ",
" subLocationsHierarchyKeyUpdated ": false
}),
});
if (! response. ok ) throw new Error (`${ response. status } : ${ await response. text ()}`);
console. log ( await response. json ()); import java . net . URI ;
import java . net . http . HttpClient ;
import java . net . http . HttpRequest ;
import java . net . http . HttpResponse ;
public class Example {
public static void main ( String [] args) throws Exception {
String body = """
{
"description": "Patrols the lobby.",
"deviceUuid": "AAAAAAAAAAAAAAAAAAAAAA",
"latitude": 37.7749,
"locationUuid": "AAAAAAAAAAAAAAAAAAAAAA",
"longitude": -122.4194,
"name": "Robocop",
"subLocationsHierarchyKey": "AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA.AAAAAAAAAAAAAAAAAAAAAA",
"subLocationsHierarchyKeyUpdated": false
}
""";
HttpRequest request = HttpRequest. newBuilder ()
. uri ( URI. create (" https://api2.rhombussystems.com/api/robot/updateDetails "))
. header (" x-auth-scheme ", " api-token ")
. header (" x-auth-apikey ", " YOUR_API_KEY ")
. header (" Content-Type ", " application/json ")
. method (" POST ", HttpRequest. BodyPublishers. ofString ( body))
. build ();
HttpResponse < String > response = HttpClient. newHttpClient ()
. send ( request, HttpResponse. BodyHandlers. ofString ());
System. out. println ( response. statusCode () + " " + response. body ());
}
}