Skip to main content

Authentication

To get an access token, use this code:

# Use Basic Auth over HTTPS to get an access token
$ curl -X POST \
--user 'username:password' \
https://whatsapp.turn.io/v1/users/login


> {
"users": [{
"token": "eyJhbGciOHlXVCJ9.eyJ1c2VyIjoNTIzMDE2Nn0.mEoF0COaO00Z1cANo",
"expires_after": "2018-03-01 15:29:26+00:00"
}]
}

Make sure to replace username:password with your username and password.

You can get your username and password from the Turn UI. With it you can request an API access token.

Turn expects for the access token to be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer token

info

You must replace token with your personal access token.