FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
470 views 4 comments
by anonymous
Hi,

I am trying to execute a command for a TRB141, with the instruction below,  but couldn't find the post schema of the API. is there a online document or sample available? Any help would be much appreciated!

 Cheers,

Jason

1 Answer

0 votes
by anonymous

Hello,

Not much of an expert with the format you have provided, however, the call /devices/{id} is just to get info about a device with some id, it does not really do anything else.

To execute a command in the device I would recommend using task manager function. The API reference can be found here.

Best answer
by anonymous

Thanks a lot Paul! Just tried an API post of task execution, got a 401 unauthorised error like below, the token has full permissions granted, any idea why still get 401 error? 

{

    "success": false,

    "errors": [

        {

            "code": "UNAUTHORIZED",

            "message": "Unauthorized. (XSRF)"

        }

    ]

}

by anonymous
Most likely you have entered it in the wrong place or it is incorrect, if the bearer token is entered correctly the response should be ok
by anonymous
The bearer is correct, All the GET requests work well. But seems any update to the device via POST doesn't work.
by anonymous
Turned out the problem is the restful client I used for testing, something wrong/missing in the post from the client. Tried postman it works. Thanks again PauliusReg for your help!