The API Access Token authenticates your requests to Pushwoosh. The Pushwoosh SDKs log this warning when no token is supplied at initialization.
There are two token types, and they are not interchangeable:
- Device API token — this is the one your app needs. It authorizes Device API calls (
registerDevice,unregisterDevice,setTags,getTags,applicationOpen,postEvent,registerUser, inbox methods, and so on) and is sent in the HTTP header asAuthorization: Token <device_api_token>. - Server API token — used for every other API method (creating messages, editing projects, account operations) and passed in the request body's
authfield.
Using the wrong type produces an authentication error.
Where to find or create it
- Log in to your Pushwoosh Control Panel.
- Go to Settings → API Access. Tokens are managed at the account level, not inside a single application.
- Click Generate New Token, choose the type Device, give it a name, and click Generate.
- Grant the token access to the right application(s) from the API Access list.
- Copy the value and pass it to the SDK at initialization alongside your application code.
Note: the token shipped with every new account (named Pushwoosh Demo App) is a Server token, so it will not work for SDK/device calls — generate a Device token instead.
Comments
0 comments
Please sign in to leave a comment.