Reply to Post
Expert Spy
gensuque
3 Posts
Member since ‎02.24.2011

newbie questions about API console and SendSMSv2

Hello

I am making my first steps in the API platform and I have a couple questions about the console:

If I want to try the send SMS API, is it mandatory to pass an oAuth access_token ?

Why doesn't the console expose the oAuth API to obtain an access token ?

 

I tried to manually construct a token request for the client credentials flow and succeded in obtaining tokens with 2-hour validity. However, when I append the access_code parameter with the value returned by the oAuth API to the SendSMSv2 request parameters, I still get a security exception...

 

How do I get sendSMS to work in the console ?

 

Thx in advance for your help

Moderator
bs595r
146 Posts
Member since ‎01.13.2012

Re: newbie questions about API console and SendSMSv2

Hello,

 

Yes, it is mandatory to pass an OAuth token. On the API console, you can do this by clicking on the dropdown menu next to the query URL entry field. It has a lock as an icon. Choose OAuth there to initiate the OAuth token flow.

 

Hope that helps,

    --brett

Expert Spy
gensuque
3 Posts
Member since ‎02.24.2011

Re: newbie questions about API console and SendSMSv2

Hi Brett

Thanks for your answers, however that does not help me much

 

The option you refer to triggers the oAuth authorisation code grant flow, which is really complicated from a user standpoint + requires to have an AT&T phone at hand which I don't have since I am based in France ... duh

 

Also the API doc for the SMS API says that the API does not require the authiorisation code grant flow and that developers shoudl obtain access tokens using the client credentials flow

 

So back to square 1: how do I get to test the send SMS API in teh console with an access token obtained using the client credentials flow ?

 

Thx in advance

 

/Guilhem

 

Moderator
bs595r
146 Posts
Member since ‎01.13.2012

Re: newbie questions about API console and SendSMSv2

Hi Guilhem,

 

This is a limitation on the API console at the moment...every API that requires OAuth needs to go through authorization code grant flow. So, in your situation, you won't be able to use the API console, since the API console is tied to a particular application (i.e. not your application); and since you don't have an AT&T phone, you won't be able to use the authorization code grant flow.

 

You could try to use some other tools. For example, if you are familiar with curl, you could use that to make requests.

 

Let me know if you need anymore more details.

 

--brett

Expert Spy
gensuque
3 Posts
Member since ‎02.24.2011

Re: newbie questions about API console and SendSMSv2

Hi Brett

Thanks for the explanation, it all makes sense now

I'll go with curl then 

/Guilhem

  • of 1