FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

13361 questions

15887 answers

25702 comments

50426 members

0 votes
426 views 9 comments
by

Thank you. After this support, I can get access_token and refresh_token with RMS API Authorize API.

But I got 403 Forbidden response from /devices RMS API. How can I get success response from RMS API ? 

Details are as follows.

--

I requested authorization with each read permission as follows.

scope="devices:read device_remote_access:read device_logs:read device_location:read device_configurations:read device_alerts:read device_actions:read"

I can get code and tokens. Then I requested /devices RMS API with access_token. There is no required parameter in devicesGet API document.

GET /api/devices HTTP/1.1
Host: rms.teltonika-networks.com
User-Agent: curl/7.64.1
Accept:application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJhOGIxYTBj...(omit)

Then I got 403 Forbidden response as follows.

HTTP/1.1 403 Forbidden
Server: nginx/1.19.1

Date: Tue, 05 Jan 2021 07:35:42 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache, private
X-RateLimit-Limit: 100000
X-RateLimit-Remaining: 99992
X-RateLimit-Reset: 1612421552
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-XSS-Protection: 1; mode=block
Content-Security-Policy: form-action 'self' *.rms.teltonika-networks.com
Content-Security-Policy: frame-ancestors 'self' *.rms.teltonika-networks.com
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Accept,Authorization,Content-Type,Origin,X-Requested-With,X-XSRF-TOKEN
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
Access-Control-Max-Age: 86000

{"success":false,"errors":[{"code":"FORBIDDEN","message":"Forbidden."}]}

1 Answer

0 votes
by
Hi,

Seems like I was able to reproduce the issue, but it fixed after couple of minutes and return list of devices as supposed to. Could you please check again if the issue still persists?

EB.
by

Thank you for your checking.

I still get 403 Forbidden at Date: Tue, 05 Jan 2021 08:38:13 GMT.

My RUT240 cannot get Web UI link on RMS with "unreachable" error. Is it related ?

by
Try creating a new token with additional scope devices:read and then test the API.

EB.
by
Instead of this link, try using our testing API interface here: https://developers.rms.teltonika-networks.com/pages/api.html

Authenticate with your token and find GET /devices. Maybe even try adding all the scopes to the token to make sure you're not using anything additional that would require more permissions than you have.

EB.
by

I tried GET /api/devices with access_token which acquired by login with all Authorization Scopes as following URL.

But I got 403 Forbidden. Is there any other required permission settings or pre configuration for RMS API ?

--

http://rms.teltonika-networks.com/account?client_id=9251e430-6216-4e88-82f9-a006a985d33c&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&state=Mjg5YTUxNTIzM2Q1Y2ZlNjVmNGU1N2Y5NTk3MTEzYTg5ODA3YTM5NjhmNjRjYjg4ODU2OGQ5NWVhNjcyMDgxZQo&code_challenge=Z1drn8Pcz0AxdD7JaWUPQ7yOjGAJQyDbHG7sxXNrKJw&scope=companies%3Adelete+companies%3Aread+companies%3Awrite+credit_transfer_codes%3Adelete+credit_transfer_codes%3Aread+credit_transfer_codes%3Awrite+credits%3Aread+credits%3Awrite+device_actions%3Aread+device_actions%3Awrite+device_alert_configurations%3Adelete+device_alert_configurations%3Aread+device_alert_configurations%3Awrite+device_alerts%3Adelete+device_alerts%3Aread+device_alerts%3Awrite+device_configurations%3Aread+device_configurations%3Awrite+device_credits%3Aread+device_hotspots%3Adelete+device_hotspots%3Aread+device_hotspots%3Awrite+device_location%3Adelete+device_location%3Aread+device_location%3Awrite+device_logs%3Adelete+device_logs%3Aread+device_logs%3Awrite+device_passwords%3Aread+device_passwords%3Awrite+device_remote_access%3Adelete+device_remote_access%3Aread+device_remote_access%3Awrite+device_speedtests%3Adelete+device_speedtests%3Aread+device_speedtests%3Awrite+devices%3Adelete+devices%3Aread+devices%3Awrite+files%3Adelete+files%3Aread+files%3Awrite+report_templates%3Adelete+report_templates%3Aread+report_templates%3Awrite+reports%3Adelete+reports%3Aread+reports%3Awrite+smtp_configurations%3Adelete+smtp_configurations%3Aread+smtp_configurations%3Awrite+tags%3Adelete+tags%3Aread+tags%3Awrite+user_invitations%3Adelete+user_invitations%3Aread+user_invitations%3Awrite+users%3Adelete+users%3Aread+users%3Awrite

by
Hi,

Could you please send me your username/email via private message that you use in RMS?

Thank you.

EB.
by

Thank you for your support.

With access_token generated on RMS "ACCESS TOKENS" page, I can get device information as RMS API response.

https://rms.teltonika-networks.com/account/settings/tokens

Also, I am required to add permissions in this page. To get device information, it is OK with checking only "devices:read".

by
Glad you got it sorted out.

Have a nice day.

EB.