Getting an Access Token

Request a token with your service account, send it on every call, and request a new one when it expires after an hour.

Quick Reference

Call Obtain access token with your service account username and password.

Send it as a URL-encoded form with the password grant type.

Put the token in the Authorization header as a Bearer token on every other call.

Request a new token every hour.

Before You Start

You have the service account username and password for the environment you're calling.

You're signed in to the Developer Portal.

Step 1 — Request the Token

Call Obtain access token

In Documentation, open Auth and select Obtain access token. Send your service account username and password with the OAuth 2.0 password grant, as a URL-encoded form.

Read the response

A successful call returns the access token, its type (bearer) and how many seconds it lasts. A wrong username or password returns an invalid grant error.

Step 2 — Send It on Every Call

Add the Authorization header

Every call except the token request carries the token as a Bearer token in the Authorization header.

Authorization: Bearer YOUR_ACCESS_TOKEN

Step 3 — Renew It Every Hour

Request a new token when it expires

Tokens last one hour (3,600 seconds). Request a new one before it runs out, or as soon as a call fails because the token expired.

Tips

DO

  • •Reuse one token for all calls until it expires.
  • •Request tokens from your server, never from a browser or a phone app.
  • •Use the Stage service account while you build and test.

WATCH FOR

  • •Send the token request as a URL-encoded form, not JSON.
  • •Never log or share the token or the service account password.
  • •Tokens expire after one hour.

Troubleshooting

Check the username and password, and that you're using the service account for the environment you're calling.

The token has probably expired. Tokens last an hour, so request a new one.

In Documentation, open Auth, then Obtain access token. It shows the request, the responses, code examples and a Test Request button.

Use this guide with AI.

Ask RAZE AI here, or hand the plain-text guide to the assistant you already use.

Was this guide helpful?

Still stuck? Ask RAZE.

Ask RAZE AI for an instant answer from these guides, or send a request and the RAZE support team replies by email.

  1. Ask RAZE AI.

    Instant answers from these guides, any time.

  2. Send a support request.

    Tell us the product and guide; the form is here.

Goes straight to the RAZE support inbox.