Specify HTTP request headers and parameters and review response fields in the client credentials flow (2-legged OAuth) and the authorization code flow (3-legged OAuth).
Note:
By using this API and its documentation and building an integration, you agree to the Additional API Terms and Guidelines.
HTTP request headers
The request headers are:
Header | Value and description |
---|---|
Content-Type
|
|
Accept
|
|
Authorization
|
In each API call, pass the access token in this header with the
|
Basic authentication scheme
When you get an access token, you can use the basic authentication scheme instead of passing your client ID and secret in the /oauth/v2/tokens
request body. To use this scheme, you encode and pass these credentials in an Authorization Basic
header.
See also Basic Authentication Scheme.
To generate the Authorization Basic
header value:
-
Concatenate the
client_id
andclient_secret
with a colon (:
) as a separator.base64.encode("<client_id>:<client_secret>");
-
Apply the Base64-encoding algorithm to the string:
base64.encode("5e175cbb7f88e2048bd95323bbc9ca2fcec32ad60f95f7ee66ab53e099abe6f3:pJ4qRe2sdXRP0Whr3bwz9D37exFuuOtqJDRHMmmlLWV7J25rH7oItrPNCKzhaQf2");
-
Pass the Base64-encoded string as a basic HTTP
Authorization
header:Authorization: Basic NWUxNzVjYmI3Zjg4ZTIwNDhiZDk1MzIzYmJjOWNhMmZjZWMzMmFkNjBmOTVmN2VlNjZhYjUzZTA5OWFiZTZmMzpwSjRxUmUyc2RYUlAwV2hyM2J3ejlEMzdleEZ1dU90cUpEUkhNbW1sTFdWN0oyNXJIN29JdHJQTkNLemhhUWYy
Scopes
Note:
Some Indeed APIs have additional scopes that you must pass when you request the access token. For API-specific scopes, see the API documentation for each API.
Name | Consent string | Description |
---|---|---|
email
|
View your email address. |
For 3-legged authorization only. When calling the |
employer_access
|
List employers associated with a user account and get an access token for an employer. |
Lists all employer accounts associated with the user and is required to get an access token for an employer. To list employers and get an access token for an employer:
|
offline_access
|
Maintain the permissions that you have granted. |
For 3-legged authorization only. Required to generate a refresh token. Indeed OAuth access tokens expire after one hour. To get an access token, use a refresh token. |
Request body parameters
You can include request body parameters for these endpoints:
Request body parameters for oauth/v2/authorize
Name | Description |
---|---|
client_id
|
Required. Client ID. Example:
|
redirect_uri
|
Required. URL-encoded redirect URL. Identifies the redirect page on your site where the user captures the authorization code. It must match one of the redirect URLs that your app registers. See Get a client ID and secret. Example: Encode
to
|
scope
|
Optional. Permissions that the client app requests. See scopes. You must URL-encode and space-delimit scopes, which replaces the spaces with plus signs ( Example:
|
response_type
|
Required. Value is always Example:
|
state
|
Recommended. Prevents CSRF attacks. Can be any unique string your app creates to maintain state between the request and callback. Indeed passes this parameter to your redirect URI. See the RFC documentation on CSRF attack against redirect-uri for more information. Example:
|
prompt
|
Optional. Prompts the authorizing user with an Indeed employer selection screen, from which the user chooses the employer account assigned to your access token. To do this, add the Example:
|
Request body parameters for oauth/v2/tokens
Name | Description |
---|---|
code
|
Required to exchange an authorization code for an access token. The authorization code. To exchange a refresh token for an access token, specify Example:
|
refresh_token
|
Required to exchange a refresh token for an access token. The refresh token returned with your user's access token. To exchange an authorization code for an access token, specify Example:
|
grant_type
|
Required. To get an authorization code, this value must be To submit a refresh token to get an access token, this value must be Example:
Or
|
client_id
|
Conditional. Your client ID. Instead of sending your Example:
|
client_secret
|
Conditional. Your client secret. Instead of sending your Example:
|
scope
|
Conditional. To list employer accounts associated with the user that registered the app or to get an access token for one of these associated employer accounts, pass Example:
|
redirect_uri
|
Required. Your URL-encoded redirect URL. Must match the redirect URL you specify when you request an authorization code. Example: Encode
to
|
Response fields
Calls to these endpoints return these response fields:
- Response fields for oauth/v2/authorize
- Response fields for oauth/v2/tokens
- Response fields for v2/api/userinfo
Response fields for oauth/v2/authorize
Name | Type | Description |
---|---|---|
code
|
String |
Authorization code. Valid for 10 minutes. Example:
|
state
|
String |
Optional. Appears only if you pass it in the request. Example:
|
Response fields for oauth/v2/tokens
Name | Type | Description |
---|---|---|
access_token
|
String |
Your access token. Example:
|
id_token
|
String |
Your ID token — see the OpenID Connect 1.0 specification. Example:
|
expires_in
|
Integer |
Token is valid for one hour (3600 seconds). Example:
|
token_type
|
String |
Value is always Example:
|
refresh_token
|
String |
You'll receive a refresh token only when you request the Example:
|
scope
|
String |
The actual permissions granted to your app. For example, Example:
|
consented_scope
|
String |
A space-delimited string of all scopes that the user has granted to your app. Can include scopes that are not in this current access token – scopes in that token are represented by the Example:
|
Response fields for v2/api/userinfo
Name | Type | Description |
---|---|---|
sub
|
string |
Unique identifier for the user's account. Example: 248289761001
|
email
|
string |
User's email address. Example: [email protected]
|
email_verified
|
boolean |
Indicates whether the user has verified their email address. Example:
|
employers
|
object |
List of employer accounts, including IDs and names, associated with the user account. This field requires that the user grant the |