FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14118 questions

16778 answers

27557 comments

53939 members

0 votes
181 views 1 comments
by

Hello,

I'm writing a script which gets the MAC address of the devices connected to a router. My understanding is that I can do this by triggering the /api/port-scan endpoint on the RMS API, and then using the provided channel I can query the status using HTTP at the /status/channel/<CHANNEL> endpoint.

I can successfully trigger a port-scan - getting back a "success": "true" message with a channel name. But when I do an HTTP request to the status endpoint, I get back an "UNAUTHORIZED" code.

I do:

curl 'https://rms.teltonika-networks.com/status/<CHANNEL>' -H 'authorization: Bearer <TOKEN>'

using a Personal Access Token I've made in RMS with all the possible permissions. And I get back:

{"code":"UNAUTHORIZED","message":"Unauthorized."}

Is this a problem with the HTTP endpoint, my access token or my request structure?

I've also tried to connect to the status interface via socket.io with no luck - using the examples given in the API documentation tends to report an error due to HTTP code 200. Do you have a working example of this written in js?

Thanks!

Leo

2 Answers

0 votes
by
I've spent some time playing with the status API and had no luck. Could someone at at Teltonika comment on if this works as documented?
by

Hello,

Thank you for your question.

To get the status information via HTTP, I would recommend using a different request link.

Instead of:  https://rms.teltonika-networks.com/status/<CHANNEL>

Try using: https://status.rms.teltonika-networks.com/channel/<CHANNEL>

The links will be updated in the official documentation, sorry for any inconvenience.

Let me know how it goes.

Best regards,

Justas C.

0 votes
by

Hello,

I have some additional information regarding this situation. Both API status links should work now, which means you can use either this link:

https://rms.teltonika-networks.com/status/channel

Or this link:

https://status.rms.teltonika-networks.com/channel

The MAC address will be displayed in the Ports -> Devices section.

Best regards,

Justas C.