Publisher Preferences APIs

Document created by catherine.racette on Mar 14, 2018Last modified by catherine.racette on Mar 15, 2018
Version 2Show Document
  • View in full screen mode

Overview

Publisher Preference APIs enable you to fetch and update publisher preferences such as time zone and currency.

Before using PubMatic APIs, first generate the API Token. For more information, refer to Getting Started with PubMatic APIs

Supported Operations

 

Get Publisher Preferences

Request Headers

Header NameTypeValueRequiredDescription
Content-Typeapplication/jsonYes
AuthorizationStringBearer ${access_token}YesSend the access token generated for authentication in place of ${access_token}. For more information about access tokens, refer to Getting Started with PubMatic APIs.

   

Request Query Parameters

Parameter NameTypeRequiredValidattionsDescription
keyStringYesYesValue of the key will be 'currency' to get the currency preferences, 'timezone' to get more time zone preferences.

 

Response Body

Response Body ParameterTypeDescription

publisherId

LongThe unique ID of the publisher.
preferencesMapHasMap<String,String>

 

Sample Response JSON

{
    "publisherId": 2685,
    "preferencesMap": {
        "timezone": "ist",
        "currency": "1"
    }
}

Currency Details are available in: The specified item was not found.

  

Examples

Get time zone and currency details for publisher account 2685

Request URL : http://demohost.pubmatic.com/inventory/publisherPreferences/2685?key=timezone&key=currency

Response : 
               {
                      "publisherId": 2685,
                      "preferencesMap": {
                                    "timezone": "ist",
                                     "currency": "1"
                      }
               }

 

Get time zone details for publisher account 2685

Request URL : http://demohost.pubmatic.com/inventory/publisherPreferences/2685?key=timezone

Response :  
               {
                      "publisherId": 2685,
                      "preferencesMap": {
                                    "timezone": "ist"
                      }
               }

 

Get currency details for publisher account 2685

Request URL : http://demohost.pubmatic.com/inventory/publisherPreferences/2685?key=currency

Response :
               {
                      "publisherId": 2685,
                      "preferencesMap": {
                                     "currency": "1"
                      }
               }

 

Invalid request

Request URL :http://demohost.pubmatic.com/inventory/publisherPreferences/2685

Response :                 
[{
  "errorCode": "update.preferences.params.missing",
  "error": "Please pass valid input criteria"
}]

 

Update Publisher Preferences

Sample Request: http://demphost.pubmatic.com /inventory/publisherPreferences/2685

 

Request Headers

Header NameTypeValueRequiredDescription
Content-Typeapplication/jsonYes
AuthorizationStringBearer ${access_token}YesSend the access token generated for authentication in place of ${access_token}. For more information about access tokens, refer to Getting Started with PubMatic APIs.

 

Response Body

Response Body ParameterTypeRequiredDescription

publisherId

LongYesThe unique ID of the publisher.
preferencesMapHasMap<String,String>Yes

 

Sample Response JSON

{ "publisherId": 2685,
  "preferencesMap":
      { "currency": "1",
    "timezone":"ist"
    }             
  }

Currency Details are available in: Currencies Supported in PubMatic 

  

Examples

Update time zone and currency details for publisher account 2685

Request URL : http://demohost.pubmatic.com/inventory/publisherPreferences/2685

Body :                 
               {
                      "publisherId": 2685,
                      "preferencesMap": {
                                    "timezone": "pst",
                                     "currency": "2"
                      }
               }

 

Update time zone details for publisher account 2685

Request URL : http://demohost.pubmatic.com/inventory/publisherPreferences/2685

Body :     
               {
                      "publisherId": 2685,
                      "preferencesMap": {
                                    "timezone": "PST"
                      }
               }

 

Update currency details for publisher account 2685

Request URL :  http://demohost.pubmatic.com/inventory/publisherPreferences/2685

Body :
               {
                      "publisherId": 2685,
                      "preferencesMap": {
                                     "currency": "2"
                      }
               }

 

Invalid request

Request URL :http://demohost.pubmatic.com/inventory/publisherPreferences/2685

Body :                
          {
                      "publisherId": 2685,
                      "preferencesMap": {
                      }
             }


Response : [{"errorCode":"update.preferences.params.missing","error":"Invalid Parameters"}]

Attachments

    Outcomes