/
Get token
Get token
Use your application's credentials and the user's credentials to retrieve an access token by sending a HTTP POST message to https://app1pub.smappee.net/dev/v1/oauth2/token
POST /dev/v3/oauth2/token HTTP/1.1
Host: app1pub.smappee.net
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
grant_type=password&
client_id=[YOUR_APP_ID]&
client_secret=[YOUR_CLIENT_SECRET]&
username=[USER_NAME]&
password=[USER_PASSWORD]
for readability the above parameters are separated by CRs, in practice the HTTP body should be one concatenated string separating the key value pairs with a &
If the server side validation of the passed credentials went well, you will receive a HTTP OK containing the token information (see below). This token has to be passed with each successive API call. The token has an expiry period of 10 hours (36000 seconds). After the token has expired, you can use the Refresh token to retrieve a new access token.
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"5fd0cf9a-fd95-38d3-a391-887b0dfa8e86",
"expires_in": 36000,
"refresh_token":"326ce36a-c101-356e-9686-b695bf924f0d",
}
, multiple selections available,
Related content
Get Servicelocations
Get Servicelocations
Read with this
Share access to service location
Share access to service location
More like this
Refresh token
Refresh token
Read with this
Javascript example code
Javascript example code
More like this
Get Electricity Consumption
Get Electricity Consumption
Read with this
Create service location
Create service location
More like this