Customize your setup with MoPub’s Publisher Management API
The Publisher Management API is a public REST API that we recently launched to help publishers customize and manage your setup on our Publisher UI faster and with more consistency.
With the Publisher Management API, you can fetch, create, update, and delete (or archive) information on selected resources to manage your MoPub setup programmatically in addition to managing manually within our UI.
Supported resources include: Apps, Ad Units, Orders, Line Items, and Advanced Bidding.
Create an API key
The first step to taking advantage of the API is to create an API key to use for authenticating requests. Each API request sent must include a valid API Key as a header.
You will first need to create an API Key. You can do so by visiting your “Account Settings” tab on mopub.com, and scroll down to the “Publisher Management API Keys” section. Once here, you can create a new API key by clicking on the “New API key” button. A dialogue-box will appear, where you can name your API key.
After you have named your key and clicked on the “Create new API key” button to proceed, your new API key will appear in the dialogue box as shown below. Please note down this API key in a safe place, as it will only be shown to you once and cannot be recovered.
A URL based versioning will be used by including the version number in the URL. Not all resources will be on the same version so make sure to check the Change Log provided for each resource.
The first version will be v1 so the url will look like this:
Important: Each resource definition will include a Change Log including when versions have been deprecated.
The API router will automatically load the most recent version of the appropriate view that does not exceed the specified version. If the api version ‘v2’ is specified and there is no specified apps.py file in the /v2/ folder, the router will automatically load the v1 version. This allows us to avoid duplicating the entire API every time we need to bump the version. The most recent version is available under ‘latest’:
- Rate Limiting: an over rate limit of 1000 requests per minute across all resources is enforced. For the Line Item resource a rate limit of 5 requests per second is enforced.
- Only account Administrators can generate Keys.
- You can create up to 10 active Keys. All keys are read and write.
- This is the only time that the API key is visible. MoPub does not store these keys; if the key is lost, we will not be able to provide it again. A new Key must be generated.
- Keys will auto-expire after 6 months, once a key is expired it can no longer be used to perform any functionality on the API. A new one must be created and used for future API usage.
- Keys can also be deleted from your “Account settings” page prior to the 6-month expiration date, once deleted the key will no longer be valid.
- Please be mindful when sharing API keys with others to ensure the security of your data and confidential information.
curl -X GET \ 'https://api.mopub.com/v1/orders/' \ -H 'x-api-key: 9b1deb4d3zzzb7d4bad9bd2b0d’
How can we make this article better for you?
Last updated July 14, 2021
TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.
© 2021 MoPub (a division of Twitter, Inc.)