Authentication
The API uses OAuth 2.0 client credentials. Exchange your application’s credentials for a token, then send it on each request.
curl -u "$CLIENT_ID:$CLIENT_SECRET" \ -d grant_type=client_credentials \ -d "scope=screens:read campaigns:read campaigns:write" \ https://partner-api.smartcast.media/oauth/tokencurl -H "Authorization: Bearer $TOKEN" https://partner-api.smartcast.media/v1/screensTokens last 30 minutes. Cache one and fetch a new one shortly before expires_in runs out, or when you get a 401.
Scopes
Section titled “Scopes”| Scope | Allows |
|---|---|
screens:read |
Screens and availability |
creatives:read |
Reading creatives |
creatives:write |
Uploading creatives |
campaigns:read |
Reading campaigns, pricing plans |
campaigns:write |
Creating, editing, submitting, cancelling |
stats:read |
Stats and reports |
Environments
Section titled “Environments”| Environment | Base URL |
|---|---|
| Live | https://partner-api.smartcast.media |
| Sandbox | https://partner-api-sandbox.smartcast.media |
Credentials are separate per environment. A sandbox token is refused in live, and the reverse.
Keeping secrets safe
Section titled “Keeping secrets safe”Call the API only from your server, never from a browser or mobile app. An application can have two active secrets at once, so you can rotate without downtime.