Hi everyone,
I am trying to figure out why the API call generates 400 bad request. The API executes the enable lost mode on iOS.
Hi everyone,
I am trying to figure out why the API call generates 400 bad request. The API executes the enable lost mode on iOS.
Check with the authorization and other information used.
Hi @tamsin-tim
400-Bad Request error code is generated when the web-service request is invalid. Kindly re-assure that you make a valid HTTP request.
Catherine George
Hexnode UEM
Attempting to make the below HTTP request:
curl -H “Authorization:DavLbkECurylxJG1tjx7” -H “Content-Type:application/json” -d '{"users":[0],"usergroups”:[0],”devices”:[1],”devicegroups”:[0]}’ https://rdspos.hexnodemdm.com/api/v1/actions/enable_lostmode/
The API call generates the following HTTP response:
“Content-Type:application/json” -d ‘{“devices”:[1]}’ https://rdspos.hexnodemdm.com/api/v1/actions/enable_lostmode/<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>400 Bad Request</title></head><body><h1>Bad Request</h1><p>Your browser sent a request that this server could not understand.<br /></p></body></html>
Any suggestions of improvement?
Well, it seems that you have used inappropriate quotes to enclose parameters in the API call.
I am reminding you that ”
and "
are not the same. Though it looks similar, these quotation marks are different from each other. You are supposed to use straight double quotes "
throughout.
Catherine George
Hexnode UEM
Don't have an account? Sign up