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

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" \
> ''
{ "error": "invalid_client" }
pi@raspberrypi:~ $

None of the fixes I found on the forum work.

Suggest 1) Use ''

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" \

response (token changed slightly)


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