Get started with Moloco Ads API
This page helps you get started with Moloco Ads API.
Before you start
To make requests to Moloco Ads API, you need to be signed in as a Moloco Ads user. If you don't already have an account with us, please reach out to a Moloco representative to sign up for one. Moloco will create your account and assign it to a workplace, where you can manage everything related to creating, launching, and analyzing campaigns.
Important:
When you sign up, be sure to use a valid email address where you can receive email communications from us. We will be periodically sending out important communications regarding any upcoming API version deprecations, updates to existing API endpoints, etc.
After your account has been created, you should receive an email to reset your password. You must click the link in the email and reset your password to be able to access your account.
Note: You must be using Transport Layer Security (TLS) ver. 1.2 or later to be able to use our services. If you need help setting up or upgrading to TLS ver. 1.2 or later, reach out to your Moloco representative.
Get an access token with your API key
To create an API key, you must sign in to Moloco Ads and follow these instructions. After you have created an API key, you must make a POST API request with your API key.
The following example shows you how you can use your command-line interface to make a POST API request to get an access token from Moloco. For api_key
, copy over the API key you have created in Moloco Ads DSP.
$ curl -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"api_key":"$API_KEY"}' \
https://api.moloco.cloud/cm/v1/auth/tokens
{
"token":"$TOKEN"
}
As in the example, the response includes your access token, which is the value of the token
property. You must include your access token in the Authorization
header like the following when making requests to Moloco Ads API.
Authorization: Bearer $TOKEN
Note: Your API requests are rejected in the event that you have failed to include an access token, included the incorrect token, or your token has expired. An access token is valid for 30 days, and you must periodically refresh the token before it expires. For more information, see Refresh the existing token.
Updated 7 days ago