Getting Started with PubMatic APIs

Document created by catherine.racette on Mar 9, 2017Last modified by catherine.racette on Nov 21, 2017
Version 12Show Document
  • View in full screen mode

Getting Started with PubMatic APIs

Note: Before you can begin implementing PubMatic APIs, you must follow the instructions below for registration and token generation in Apigee. API Documentation can be accessed through the Developers Home page on this community.

For help with the API process, please email


Step 1: Register with PubMatic

Register to use the PubMatic APIs using this Registration Form. Complete the details and submit for approval.

  • Publisher Requirements: Provide your Publisher ID assigned by PubMatic.
  • Developer Requirements: Provide your Github profile ID and LinkedIn profile ID, if it exists, to speed up your profile activation.
  • Partner Requirements: Provide the name of the person at PubMatic who referred you to speed up your profile activation.
The registration request will be reviewed by a PubMatic API Administrator. Once approved (allow 1-2 business days), you will receive a confirmation email.

Step 2: Request a PubToken

  1. Send an email to  to request a PubToken, which will be your permanent token for use in the PubMatic system.
    Provide the following information in the request:
  • Environment (e.g., Production/Sandbox)
  • Publisher ID
  • Site ID
  • PubMatic email ID
  • Apigee account details

    It is possible that the PubToken for Production and SandBox environments will be different.When sending an email to to receive a PubToken, be sure to specify which environment it is for: Production or Sandbox.

  1. After your account is approved (allow 1-2 business days) you will receive an email from This email will contain details for setting a password. Once you've followed the instructions to set your password, log out of the current screen.
  2. Go to and log in using your Apigee UserName and Password.
  3. Open the My Apps tab and click Add a new app.
    This tab should open by default after logging in, but can also be accessed by clicking your username in the upper-right and selecting My Apps.
  4. After successfully creating an app, click on the app name (on the My Apps tab) to view your Consumer Key and Consumer Secret.

Step 3: Generate Access Token

Use the following instructions to generate the Access Token (PubToken) using the Consumer Key and Consumer Secret. 

The PubToken will expire 60 days from the time it is created.

  1. Generate a base64 encode of Consumer Key:Consumer Secret string (you may use -
    For example, if your consumer key= CANfdsfdasdfFG and consumer secret key= XyZdfsdLRV. You should generate a base64 encode of
  2. Call the following HTTP URL using any suitable HTTP utility (PubMatic uses curl). Replace Base64Encoded (key:secret) placeholder in the curl call
    below with an encoded value generated in above step. Replace <pubMaticApiKey> placeholder in curl call below with 'PubToken' provided to you.

    curl -H "Content-Type:application/x-www-form-urlencoded" -H "Authorization:Basic <base64_encoded_key:secret>" -X POST -d 'grant_type=password&username=<pubMaticApiKey>&password=<pubMaticApiKey>'

    curl -H "Content-Type:application/x-www-form-urlencoded" -H "Authorization:Basic <base64_encoded_key:secret>" -X POST -d 'grant_type=password&username=<pubMaticApiKey>&password=<pubMaticApiKey>'

  3. With every API call, set the HTTP header "Authorization with the value, "Bearer $access_token".

    $access_token is a placeholder for the value you got in the above response.