richardscafuto

Using CURL to get your Bearer and M2M Connectivity Token

Discussion created by richardscafuto Employee on Aug 8, 2017


Use this curl command to get your ThingSpace Bearer Token. Times out after one hour.
curl -X POST -d "grant_type=client_credentials" -H "Authorization: Basic BASE64_GOES_HERE" -H "Content-Type: application/x-www-form-urlencoded" "https://thingspace.verizon.com/api/ts/v1/oauth2/token"

 

Result
{"access_token":"db9708cf23b64f0300aaa7af3aaa7d9","scope":"am_application_scope default","token_type":"Bearer","expires_in":3600}#


Use this to get your M2M Connectivity API token. Times out after 20 minutes of inactivity.
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer db9708cf23b64f0300aaa7af3aaa7d9" -d "{\"password\": \"M2M_PASSWORD_GOES_HERE\", \"username\": \"M2M_USERNAME_GOES_HERE\"}" "https://thingspace.verizon.com/api/m2m/v1/session/login"

 

Result
df8fd2bc-20be-661f-ac47-6b293bb0f1b9

Outcomes