question

justin-nguyen11499 avatar image
justin-nguyen11499 asked justin-nguyen11499 edited

Unauthorized (code 401)

I using Ringcentral.Client in .Net, when I authorize, I get refresh token and access token. I using refresh token to get new access token. I work very nice but after 2 hours I can't send any message and I get exception

401 (Unauthorized): POST https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms

But I still recieve event message inbound from another user send to me in method subciption instant message.

I don't understand that. In document, I see refresh token exprire time is 7days, can you explain me about that ?

subscriptionauthorization
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Anirban avatar image
Anirban answered Anirban edited

This is strange though ... 401 means there is access issue with credentials or token etc.

Can you make sure and check if you are using right credentials like client_name, secret, password, extension etc correctly and not changed now

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

justin-nguyen11499 avatar image
justin-nguyen11499 answered justin-nguyen11499 edited

I sure client_name, secret, password, extension is correct.Everything working about 2 hours, I can send message and recieve message as usual. But after 2 hours, I get error 401. I'm testing in sandbox

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys