Find Opportunities
POST/ad/v1/opportunity
Find ad opportunities for the user given optional screen sizes. This will generate a new ad api token that is returned in the response header.
Request
Header Parameters
Optional header to make calling the endpoint faster by not requiring a new token to be generated.
- application/json
Body
required
Width of the screen in pixels
Height of the screen in pixels
Possible values: >= 2 characters and <= 2 characters
ISO 3166-1 alpha-2 country code for the user
Possible values: >= 2 characters and <= 3 characters
ISO 639-2 language code
Possible values: non-empty and <= 256 characters
Unique Identifier for the device a session is started on. E.g should be the same for multiple users on the same device.
Responses
- 200
- 403
- 422
- 500
Successful Response
Response Headers
x-hz-ad-api-token
string
Provide this token to future requests for the same user to make their requests faster (as a new token doesn't need to be generated)
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
opportunities
object[]
required
The URL to the ad
The number of seconds the ad is
Possible values: non-empty
The ID of the ad opportunity
{
"opportunities": [
{
"ad_url": "string",
"seconds": 0,
"opportunity_id": "string"
}
]
}
Error Codes:
-
auth_invalid_key_id- Invalid Authorization - Invalid Key ID in Access Token -
auth_invalid_version- Invalid Authorization - version -
auth_malformed_access- Invalid Authorization - malformed access token -
auth_not_jwt- Invalid Authorization -
auth_token_expired- Token is expired -
auth_token_format- Invalid Authorization - {} -
auth_token_invalid_claim- Token contained invalid claim value: {} -
auth_token_invalid_type- Invalid Authorization - Invalid Token Type -
auth_token_sig_invalid- Token Signature is invalid -
auth_token_unknown- Failed to parse token -
insufficient_permissions- Insufficient Permissions
- application/json
- Schema
- Example (from schema)
Schema
Default value: true
{
"auth_success": true,
"error_code": "string",
"desc": "string"
}
Validation Error
- application/json
- Schema
- Example (from schema)
Schema
Array [
Array [
- MOD1
- MOD2
]
]
detail
object[]
loc
object[]
required
anyOf
string
integer
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Internal Server Error
Response Headers
x-hz-ad-api-token
string
Provide this token to future requests for the same user to make their requests faster (as a new token doesn't need to be generated)