Page tree


Before you can begin integrating PubMatic APIs…

You must follow the instructions below to register for API access.

Welcome

To start using PubMatic APIs you must first register via email. Use the following steps to register:

Step 1

Select Learn More for the section below that's appropriate for your role:

Publisher

 Learn more…

Email your Publisher ID assigned by PubMatic, and the other fields requested in the body of the email to: api-support@pubmatic.com.

Developer

 Learn more…

Email your Github profile ID and LinkedIn profile ID, if you have one , along with the other fields requested in the body of the email to: api-support@pubmatic.com.

Partner

 Learn more…

Email the name of the person at PubMatic who referred you, and the other fields requested in the body of the email to: api-support@pubmatic.com.


Your registration request will be reviewed by a PubMatic API Administrator who will send a confirmation email. Use the confirmation information to complete Step 2 below.

Step 2

Follow the steps below to generate the Access Token using the Consumer KeyConsumer Secret, and PubToken included in your confirmation email from PubMatic. 


Access Tokens expire 60 days from time of creation.


  1. Generate a base64 encode of your  Consumer Key:Consumer Secret  string (you can do so using, http://www.motobit.com/util/base64-decoder-encoder.asp).
    For example, if your consumer key= CANfdsfdasdfFG and consumer secret key= XyZdfsdLRV. Your base64 encode should resemble, 
    CANfdsfdasdfFG:XyZdfsdLRV .
     
  2. Call the following HTTP URL using any suitable HTTP utility (PubMatic uses the command line tool, curl). Replace the <base64_encoded_key:secret> placeholder in the curl call 
    below with your encoded Consumer Key:Consumer Secret. Replace the <pubMaticApiKey> placeholder in the curl call below with the PubToken from your confirmation email.

    Production:

    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>' http://api.pubmatic.com/v1/oauth/generateOauthToken
  3. With every API call, set the HTTP header Authorization with the value: Bearer $access_token (where $access_token is a placeholder for the value returned by the curl call you used in step b above).