Sorry, you need to enable JavaScript to visit this website.

You are here

Token request gets "invalid client"

2 posts / 0 new
Last post

Tim's picture
by Tim

Token request gets "invalid client"

Following the instructions on

https://github.com/telstra/MessagingAPI-v2/blob/master/Getting%20Started.md

Variables are set as per the example.

pi@raspberrypi:~ $ curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
> -d "grant_type=client_credentials&client_id=$CONSUMER_KEY&client_secret=$CONSUMER_SECRET&scope=NSMS" \
> 'https://tapi.telstra.com/v2/oauth/token'
{ "error": "invalid_client" }
pi@raspberrypi:~ $

None of the fixes I found on the forum work.

Suggest 1) Use 'https://sapi.telstra.com/v1/oauth/token'

Suggest 2) "Have you requested a number" - you need to pass the token to get a number

DeveloperSteve's picture
by DeveloperSteve

Hi trussell, 

Hi trussell, 

sapi token url will still work for a bit but will likely eventually be depreciated 

This just worked for me using the creds directly inline 

curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
  -d "grant_type=client_credentials&client_id=$CONSUMER_KEY&client_secret=$CONSUMER_SECRET&scope=NSMS" \
  'https://tapi.telstra.com/v2/oauth/token'

response (token changed slightly)

{"access_token":"hNrMpALWpi2E___pIVoyPB4GRouu7","token_type":"Bearer","expires_in":"3599"}

Awesome that you are using it on a raspi, would love to get a guest blog post on it if you wanted to write one

Log in or register to post comments