cURL Python JavaScript Java
bash curl --request POST \
--url ' https://api2.rhombussystems.com/api/robot/getMapImage ' \
--header ' x-auth-scheme: api-token ' \
--header ' x-auth-apikey: YOUR_API_KEY ' \
--header ' Content-Type: application/json ' \
--data ' {
"deviceUuid": "AAAAAAAAAAAAAAAAAAAAAA"
} ' \
--output output.bin import requests
url = " https://api2.rhombussystems.com/api/robot/getMapImage "
headers = {
" x-auth-scheme ": " api-token ",
" x-auth-apikey ": " YOUR_API_KEY ",
" Content-Type ": " application/json ",
}
payload = {
" deviceUuid ": " AAAAAAAAAAAAAAAAAAAAAA "
}
response = requests. post ( url , headers= headers , json= payload )
response. raise_for_status ()
with open (" output.bin ", " wb ") as f:
f. write ( response . content ) const response = await fetch (' https://api2.rhombussystems.com/api/robot/getMapImage ', {
method : ' POST ',
headers : {
' x-auth-scheme ': ' api-token ',
' x-auth-apikey ': ' YOUR_API_KEY ',
' Content-Type ': ' application/json ',
},
body : JSON. stringify ({
" deviceUuid ": " AAAAAAAAAAAAAAAAAAAAAA "
}),
});
if (! response. ok ) throw new Error (`${ response. status } : ${ await response. text ()}`);
const blob = await response. blob (); import java . net . URI ;
import java . net . http . HttpClient ;
import java . net . http . HttpRequest ;
import java . net . http . HttpResponse ;
import java . nio . file . Path ;
public class Example {
public static void main ( String [] args) throws Exception {
String body = """
{
"deviceUuid": "AAAAAAAAAAAAAAAAAAAAAA"
}
""";
HttpRequest request = HttpRequest. newBuilder ()
. uri ( URI. create (" https://api2.rhombussystems.com/api/robot/getMapImage "))
. 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 < Path > response = HttpClient. newHttpClient ()
. send ( request, HttpResponse. BodyHandlers. ofFile ( Path. of (" output.bin ")));
System. out. println ( response. statusCode () + " " + response. body ());
}
}