Skip to main content
Question

Sending SMS from n8n with Hardcoded Authorization Token

  • 13 August 2024
  • 3 replies
  • 15 views

Hello everyone,

I'm working on integrating RingCentral's SMS capabilities into my n8n workflows. I'm looking for a way to send SMS messages directly from n8n using HTTP requests to the SMS send endpoint.

However, I'd like to simplify the authentication process by using a hardcoded credential or authorization token instead of going through the full OAuth flow each time.

Is this approach possible with the RingCentral API? If so, could someone provide any pointers on how to achieve this?

Any suggestions or code examples would be greatly appreciated!

Thanks in advance!

Yes it is possible by using a JWT token. Please read this dev guide article to learn more about it.


Yes it is possible by using a JWT token. Please read this dev guide article to learn more about it.

 

Thanks, from what I understand, I’ll have to use the JWT to get an access token, rigtht?

 

> How does JWT authentication work?

> JWT authentication and password-based authentication modes are almost identical. They both are a standards-compliant OAuth flow for which developers will perform the following steps:

> The developer presents a JSON Web Token to the platform.

> The platform responds with an access token.

> The developer utilizes the access token in subsequent requests to the API. >

> &JWT authorization code flow](https://developers.ringcentral.com/guide/authentication/jwt-flow)

 

I was expecting something simpler

 


Yes it is possible by using a JWT token. Please read this dev guide article to learn more about it.

 

Thanks, from what I understand, I’ll have to use the JWT to get an access token, rigtht?

 

> How does JWT authentication work?

  • Each user needs to login the RingCentral developer portal to generate their own JWT token. Particularly for sending or accessing SMS message store, only the user who owns the JWT token, can be authenticated by your app to send SMS from their number.

> JWT authentication and password-based authentication modes are almost identical. They both are a standards-compliant OAuth flow for which developers will perform the following steps:

  • We no longer support password flow

> The developer presents a JSON Web Token to the platform.

  • That is the user JWT

> The platform responds with an access token.

  • Once you have the JWT token, you call the /token endpoint to get the access token and the refresh token (if set at the app settings). An access token is valid for 1 hour and a refresh token is valid for 7 days. You can use the refresh token to get a new access token, and every time you refresh the token, you will get a new refresh token which again is valid for another 7 days.

> The developer utilizes the access token in subsequent requests to the API. >

  • Correct

> >JWT authorization code flow](https://developers.ringcentral.com/guide/authentication/jwt-flow)

 

I was expecting something simpler

 

 

I don’t know what type of integration you have, but if you expect multiple users can login your service and send/receive SMS messages from their RingCentral phone numbers, then I think 3-legged authorization (OAuth2) is necessary. You can ask them to login once, keep their tokens and refresh them periodically until they deliberately logout.


Reply