Skip to main content
POST
/
oauth
/
token
curl --request POST \
  --url "https://api.harmonyforstaffing.com/oauth/token" \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode "grant_type=authorization_code" \
  --data-urlencode "code=abc123" \
  --data-urlencode "client_id=your_client_id" \
  --data-urlencode "client_secret=your_client_secret" \
  --data-urlencode "redirect_uri=https://your-app.com/callback"
This endpoint supports multiple OAuth 2.0 flows:
  1. Authorization Code Grant - Exchange an authorization code for tokens
  2. Client Credentials Grant - Machine-to-machine API access
  3. Refresh Token Grant - Get new tokens using a refresh token

Body Parameters

grant_type
string
required
One of: “authorization_code”, “client_credentials”, or “refresh_token”
client_id
string
required
Your application’s client ID
client_secret
string
required
Your application’s client secret

Authorization Code Grant

code
string
required
The authorization code received from the authorize endpoint
redirect_uri
string
required
Must match the original redirect URI used in the authorize request

Client Credentials Grant

scope
string
Space-separated list of requested scopes (defaults to client’s allowed scopes)

Refresh Token Grant

refresh_token
string
required
The refresh token previously obtained

Response

{
  "access_token": "eyJhbGciOiJIUz...",          // JWT token
  "token_type": "bearer",
  "expires_in": 86400,                          // Seconds until expiration
  "refresh_token": "def50200641f3e...",         // Only for authorization_code and refresh_token grants
  "scope": "read write"                         // Space-separated scopes
}
curl --request POST \
  --url "https://api.harmonyforstaffing.com/oauth/token" \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode "grant_type=authorization_code" \
  --data-urlencode "code=abc123" \
  --data-urlencode "client_id=your_client_id" \
  --data-urlencode "client_secret=your_client_secret" \
  --data-urlencode "redirect_uri=https://your-app.com/callback"

Error Responses