Page tree


Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
top
top
Table of Contents
indent20px
stylenone

Overview

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

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

Supported Operations

Method PathHTTP Method TypeDescription/Link
http://api.pubmatic.com/v1/inventory/publisherPreferences/{pub_Id}?key={val1}&key={val2}GETGet Publisher Preferences
http://api.pubmatic.com/v1/inventory/publisherPreferences/{pub_Id}PUTUpdate Existing Publisher Preferences


Get Publisher Preferences

Request Headers

Header NameTypeValueRequiredDescription
Content-Typeapplication/json
Yes
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 NameTypeRequiredValidationsDescription
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

Code Block
languagejs
linenumberstrue
{
    "publisherId": 2685,
    "preferencesMap": {
        "timezone": "ist",
        "currency": "1"
    }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


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

Examples

Get time zone and currency details for publisher account 2685

Code Block
languagejs
linenumberstrue
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

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

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


Get currency details for publisher account 2685

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

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


Invalid request

Code Block
languagejs
linenumberstrue
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://demphostdemohost.pubmatic.com /inventory/publisherPreferences/2685


Request Headers

Header NameTypeValueRequiredDescription
Content-Typeapplication/json
Yes
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

Code Block
languagejs
linenumberstrue
{ "publisherId": 2685,
  "preferencesMap":
      { "currency": "1",
    "timezone":"ist"
    }              
  }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


Info
Currency Details are available in: Currencies Supported in PubMatic 
  

Examples

Update time zone and currency details for publisher account 2685

Code Block
languagejs
linenumberstrue
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

Code Block
languagejs
linenumberstrue
Request URL : http://demohost.pubmatic.com/inventory/publisherPreferences/2685

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


Update currency details for publisher account 2685

Code Block
languagejs
linenumberstrue
Request URL :  http://demohost.pubmatic.com/inventory/publisherPreferences/2685

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


Invalid request

Code Block
languagejs
linenumberstrue
Request URL :http://demohost.pubmatic.com/inventory/publisherPreferences/2685

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


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