This endpoint supports multiple OAuth 2.0 flows:
- Authorization Code Grant - Exchange an authorization code for tokens
- Client Credentials Grant - Machine-to-machine API access
- Refresh Token Grant - Get new tokens using a refresh token
Body Parameters
One of: “authorization_code”, “client_credentials”, or “refresh_token”
Your application’s client ID
Your application’s client secret
Authorization Code Grant
The authorization code received from the authorize endpoint
Must match the original redirect URI used in the authorize request
Client Credentials Grant
Space-separated list of requested scopes (defaults to client’s allowed scopes)
Refresh Token Grant
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