API calls generate 400 bad request

Avatar
expand collapsive

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.

Tags:

All Replies

  • Avatar

    Tamsin Tim

    Participant

    Tamsin Tim

    Participant

    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?

  • Avatar

    Catherine George

    Hexnode

    Catherine George

    Moderator

    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