Sites

Document created by pubmatic-archivist on Mar 27, 2017Last modified by catherine.racette on Jun 5, 2017
Version 11Show Document
  • View in full screen mode

Description

Sites indicate the Web sites or Mobile apps for which you want to monetize inventory through the PubMatic platform. These sites are mapped to either Web sites, Mobile Web sites, Android Mobile Apps or iOS Mobile Apps.

Methods

                                       

Method Path
HTTP Method Type
Description
Link to Definition
/publisherSites?entityId={publisherId}POSTCreate a site or app in the PubMatic platformCreating a Site or App
/publisherSitesGETRetrieve the list of sites or apps associated with the publisher's accountRetrieving List of Sites or Apps
/publisherSites/{siteId}?entityId={publisherId}GETRetrieve the details of a specific site or appRetrieving Details of a Site or App
/publisherSites/{siteId}?entityId={publisherId}PUTUpdate the details of an existing site or appUpdating a Site or App
/publisherSites/{siteId}?entityId={publisherId}DELETEDelete a specific site or app from the PubMatic platformDeleting a Site or App

Creating a Site or App

 

Overview

This API allows you to create a site or app in the PubMatic platform.

 

Request

         

URI
${URI_PREFIX}/inventorymgmt/publisherSites
 
Note: For sandbox testing, $URI_PREFIX should be replaced with "http://api-sandbox.pubmatic.com/v1".
For production, $URI_PREFIX should be replaced with "http://api.pubmatic.com/v1".
HTTP Method
POST

Request Headers

                        

Header Name
Type
Value
Required
Description
Content-Type
application/json
Yes
Authorization
String
Bearer ${access_token}
Yes
Need to send the access token generating for authentication at the place of ${access_token}.
For more information about access tokens, refer to Getting Started with PubMatic APIs

Request Query Parameters

                 

Parameter
Type
Required
Validations
Description
entityId
Long
Yes
-
ID of the publisher for which the site or app needs to be created.

Request Body

                                                                                              

Body Parameter
Type
Required
Validations
Description
publisherId
Long
Yes
This should be a valid Publisher entity present in the PubMatic platform
ID of the publisher for which the site or app needs to be created.
siteDomain
Object
Yes
  • This Object is required for adding a new site domain to the system.
  • This domain must be valid and must have a valid HTTP URL.
Domain of the site or app to be created.
For example,

"siteDomain": {
"publisherId": 2685,
"domainName": "http://example.org"
}
siteUrl
String
Yes
  • This is a mandatory field and must be a valid URL.
  • Should have a unique value and is used for reporting purpose.
  • Must be less than 255 characters
URL of the site used for reporting purposes.
verticalId
Long
Yes
  • Must be one of the valid PubMatic-supported vertical IDs
  • If the publisher account is IAB enabled, then this field is not required.
Vertical/category of the site in case of a non-IAB publisher.
microVerticalId
long
No
  • Must be one of the valid PubMatic-supported micro vertical IDs
  • If the publisher account is IAB enabled, then this field is not required.
Micro vertical/category of the site in case of a non-IAB publisher. It is optional.
platformId
long
Yes
Must be one of the valid PubMatic-supported platform IDs.
 
Platform type of the site. Valid values are:
  • 1 - Web
  • 2 - Mobile Web
  • 3 - Not Defined
  • 4 - Mobile App IOS
  • 5 - Mobile App Android
monthlyImpressions
long
Yes
 
Number of monthly impressions expected by the publisher from this site.
mobileAppProfile
Object
No
In case of an Android or iOS app, this object is required.
Details or profile of the mobile app.
  • appStoreUrl indicates the app store URL of the mobile app and is required
    only if the app is available on the app store.
  • isLiveOnAppStore indicates whether the app is already available on the app
  • store or not and its value can be "true" or "false".
  • richMediaCompliances indicates the rich media compliance settings of this
    app and should contain valid values present in system. Valid values for
    richMediaCompliances are:
    • 3 - MRAID 1.0
    • 4 - ORMMA
    • 5 - MRAID 2.0
  • overridePublisherData indicates whether the publisher-provided app information
  • in the ad request should override the app details saved in the PubMatic platform or
    not. It is an optional field.
 
For example,

"mobileAppProfile": {
"appStoreUrl": "https://itunes.apple.com/us/app/ropenfly-2/id330976703?mt=8",
"isLiveOnAppStore": true,
"richMediaCompliances": [3, 4, 5],
"overridePublisherData": true
}
publisherSiteSettings
Object
No
This object is used to configure the site level settings.
 
Site-specific configuration.
  • apiSetting indicates whether the site should be marked as API in the system or not.
    Valid values are "true" and "false".
  • isCoppaCompliant indicates whether the site is COPPA compliant or not, that is, this
    site/app contains content for children below 13 years of age and the impressions served
    on this site should be COPPA-compliant. Valid values are "true" and "false".
  • forceSecureAd indicates whether this site is secure or not. Valid values are "true" and "false".

Note: If you are going to map this site to video ad tags, ensure that
this site is marked as 
API, that is, "apiSetting": true.
For example,

"publisherSiteSettings": {
"publisherId": 2685,
"apiSetting": true,
"isCoppaCompliant": false,
"forceSecureAd": 0
}
iabPrimaryVerticalList
List
No
  • Should contain valid values for primary IAB category supported by the system
  • Currently, only one value should be passed in this list.
Primary IAB category of the site. This parameter is required only if the publisher account is IAB enabled.
iabSecondaryVerticalList
List
No
  • Should contain valid values for secondary IAB categories supported by the  system.
  • User can specify up to 3 values per site.
Secondary IAB category of the site. This parameter is required only if the publisher account is IAB enabled.
privacyPolicyUrl
String
No
 
Privacy Policy URL for the site.

Sample Request for Non-IAB Publisher


URL: ${URI_PREFIX}/inventorymgmt/publisherSites?entityId=24440
Method: POST
Request Body:
{
    "publisherId": 24440,
    "siteDomain": {
        "siteDomainId": 0,
        "publisherId": 24440,
        "domainName": "https://example.org/"
    },
    "siteUrl": "https://example.org/944",
    "platformId": 1,
    "monthlyImpressions": 1000,
    "verticalId": 3,
    "microVerticalId": 38,
    "tldCount": 0,
    "apiSetting": false,
    "publisherSiteSettings": {
        "publisherId": 24440,
        "apiSetting": false,
        "forceSecureAd": 0
    }
}

Sample Request for IAB-enabled Publisher


URL: ${URI_PREFIX}/inventorymgmt/publisherSites?entityId=2685
Method: POST
Request Body:
{
    "publisherId": 2685,
    "siteDomain": {
        "siteDomainId": "",
        "publisherId": 2685,
        "domainName": "http://example.org"
    },
    "siteUrl": "http://example.org/1211",
    "privacyPolicyUrl": "http://demo.url/1212",
    "monthlyImpressions": "100000",
    "iabPrimaryVerticalList": [{
        "iabId": "IAB9"
    }],
    "iabSecondaryVerticalList": [{
        "iabId": "IAB26-2"
    }],
    "tldCount": 0,
    "platformId": 4,
    "publisherSiteSettings": {
        "publisherId": 2685,
        "apiSetting": true,
        "isCoppaCompliant": false,
        "forceSecureAd": 0
    },
    "selectedSiteGroupIds": [3],
    "mobileAppProfile": {
        "appStoreUrl": "https://itunes.apple.com/us/app/ropenfly-2/id330976703?mt=8",
        "isLiveOnAppStore": true,
        "richMediaCompliances": [3, 4, 5],
        "overridePublisherData": true
    }
}

Response

Response Body

           

Type
Description
site object
JSON response of the successfully created site

Sample Response for Non-IAB Publisher


{
    "siteId": 135745,
    "publisherId": 24440,
    "siteUrl": "https://example.org/944",
    "monthlyImpressions": 1000,
    "isDefault": false,
    "platformId": 1,
    "verticalId": 3,
    "microVerticalId": 38,
    "tldCheckEnabled": 0,
    "siteDomain": {
        "siteDomainId": 87754,
        "publisherId": 24440,
        "domainName": "https://example.org"
    },
    "vertical": {
        "verticalId": 3,
        "name": "Business and Finance",
        "id": 3
    },
    "microVertical": {
        "microVerticalId": 38,
        "name": "Women's Interest"
    },
    "platform": "WEB"
}

Sample Response for an IAB-enabled Publisher

{
    "siteId": 152743,
    "publisherId": 2685,
    "siteUrl": "http://example.org/1211",
    "monthlyImpressions": 100000,
    "isDefault": false,
    "platformId": 4,
    "privacyPolicyUrl": "http://demo.url/1212",
    "tldCheckEnabled": 1,
    "siteDomain": {
        "siteDomainId": 95708,
        "publisherId": 2685,
        "domainName": "http://example.org"
    },
    "platform": "MOBILE_APP_IOS",
    "mobileAppProfile": {
        "id": 611,
        "platformId": 4,
        "applicationName": "Rope'n'Fly 2",
        "bundle": "com.rsz.RopeFly2",
        "applicationId": 330976703,
        "paid": true,
        "version": "4.9",
        "appStoreUrl": "https://itunes.apple.com/us/app/ropenfly-2/id330976703?mt=8",
        "richMediaComplianceList": "3::4::5",
        "richMediaCompliances": [3, 4, 5],
        "isLiveOnAppStore": true,
        "isLiveOnAppStoreVal": "true",
        "overridePublisherData": true,
        "primaryIabCategory": {
            "iabName": "Hobbies & Interests",
            "iabId": "IAB9",
            "id": 186,
            "parentCategory": {
                "id": 0
            },
            "name": "Hobbies & Interests"
        },
        "primaryAppCategory": {
            "platform": "MOBILE_APP_IOS",
            "category": "Games",
            "pmCatId": 186,
            "platformCatId": 49
        },
        "secondaryAppCategories": [{
            "platform": "MOBILE_APP_IOS",
            "category": "Action",
            "pmCatId": 216,
            "platformCatId": 51
        }, {
            "platform": "MOBILE_APP_IOS",
            "category": "Arcade",
            "pmCatId": 186,
            "platformCatId": 55
        }],
        "parentPrimaryIABCategory": {
            "iabName": "Hobbies & Interests",
            "iabId": "IAB9",
            "id": 186,
            "parentCategory": {
                "id": 0
            },
            "name": "Hobbies & Interests"
        },
        "isValidApp": 0,
        "secondaryCategoryNames": ["Action", "Arcade"]
    },
    "iabPrimaryVerticalList": [{
        "iabName": "Hobbies & Interests",
        "iabId": "IAB9",
        "id": 186,
        "pubmaticAdvertiserCategoryId": 8,
        "name": "Hobbies & Interests"
    }],
    "iabSecondaryVerticalList": [{
        "iabName": "Warez",
        "iabId": "IAB26-2",
        "id": 427,
        "parentIabCatId": "IAB26",
        "pubmaticAdvertiserCategoryId": 43,
        "name": "Warez"
    }]
}

Error Codes

                               

Error Code
Error Description
DUPLICATE_SITE
Site already exists
CC01_0002
Missing or invalid {parameter}.Please provide valid {parameter}.
CC01_0002
Domain existence for {siteUrl} could not be verified, that is, site URL does not exist.
PUBSITE01_04
Missing or invalid Platform. Please provide valid Platform
PUBSITE01_03
Missing or invalid {DomainName}. Please provide valid {DomainName}
PUBSITE01_05
{param1} cannot be more than {param2}

 

 

Retrieving List of Sites or Apps

Overview

This API allows you to retrieve the list of sites or apps associated with the publisher's account based on the filter criteria provided by the user.

 

Request

         
URI

${URI_PREFIX}/inventorymgmt/publisherSites


Note: For sandbox testing, $URI_PREFIX should be replaced with "http://api-sandbox.pubmatic.com/v1".

 

For production, $URI_PREFIX should be replaced with "http://api.pubmatic.com/v1".
HTTP MethodGET

Request Headers

                        

Header Name
Type
Value
Required
Description
Content-Type
application/json
-
Yes
-
Authorization
String
Bearer ${access_token}
Yes
Need to send the access token generating for authentication at the place of ${access_token}.
For more information about access tokens, refer to Getting Started with PubMatic APIs
   

Request Query Parameters

                                                                  

Parameter NameTypeRequiredValidationsDescription
publisherIdLongYes ID of the publisher account associated with the sites or apps.
platformIdIntegerNo Platform type of the sites or apps which need to be retrieved.
verticalIdIntegerNo Vertical/category of the sites or apps which need to be retrieved in case of a non-IAB publisher.
siteUrlStringNo URL of the sites or apps which need to be retrieved.
trafficStatusStringNo Traffic status of the sites or apps which need to be retrieved, that is, whether the sites or apps are receiving any traffic in the PubMatic platform or not. Valid values are "active" and "inactive".
tldCheckEnabledIntegerNo Indicates whether domain whitelisting has been enabled for the site/app or not in case of publisher networks. Valid values are 0 (for false) and 1 (for true).
iabPrimaryVerticalListLongNo Primary IAB categories of the sites or apps which need to be retrieved in case of an IAB-enabled publisher.
siteIdLongNo ID of the site or app which needs to be retrieved.

 

Note: Sorting is also provided on modificationTime and adTagCount.

Sample Request


${URI_PREFIX}/inventorymgmt/publisherSites?filters=publisherId+eq+2685&verticalId+eq+2&dimensions=adTagCount&sort=-adTagCount&pageNumber=2&pageSize=200&trafficStatus=active

 

${URI_PREFIX}/inventorymgmt/publisherSites?filters=publisherId+eq+6846&filters=tldCheckEnabled+eq+1

Response

Response Body

           

Type
Description
site object
JSON response of the site

Sample Response for Non-IAB Publisher


{
    "siteId": 24441,
    "publisherId": 24440,
    "siteUrl": "http://www.mycompany.com",
    "monthlyImpressions": 10000,
    "isDefault": false,
    "platformId": 1,
    "privacyPolicyUrl": "",
    "verticalId": 27,
    "microVerticalId": 27,
    "tldCount": 0,
    "tldCheckEnabled": 0,
    "siteDomain": {
        "siteDomainId": 13841,
        "publisherId": 24440,
        "domainName": "http://www.mycompany.com"
    },
    "vertical": {
        "verticalId": 27,
        "name": "Real Estate",
        "id": 27
    },
    "microVertical": {
        "microVerticalId": 27,
        "name": "Real Estate"
    },
    "adCategoryList": [],
    "publisherSiteSettings": {
        "publisherId": 24440,
        "publisherSiteId": 24441,
        "apiSetting": false,
        "isCoppaCompliant": false,
        "dmEnabled": false,
        "forceSecureAd": 0
    },
    "selectedSiteGroupList": [{
        "id": 2,
        "name": "Premium"
    }, {
        "id": 3,
        "name": "RTB"
    }],
    "adTagCount": 12,
    "modificationTime": "1970-01-01 00:00:00",
    "trafficStatus": {
        "id": 24441,
        "impressions": 0,
        "revenue": 0
    }
}

Sample Response for IAB-enabled Publisher 

{
    "siteId": 2686,
    "publisherId": 2685,
    "siteUrl": "http://john.blogspot.com",
    "monthlyImpressions": 1000,
    "isDefault": true,
    "platformId": 1,
    "tldCount": 0,
    "tldCheckEnabled": 0,
    "siteDomain": {
        "siteDomainId": 1305,
        "publisherId": 2685,
        "domainName": "http://john.blogspot.com"
    },
    "adCategoryList": [],
    "iabPrimaryVerticalList": [{
        "iabName": "Non-Standard Content",
        "iabId": "IAB25",
        "id": 417,
        "pubmaticAdvertiserCategoryId": 43,
        "name": "Non-Standard Content"
    }],
    "iabSecondaryVerticalList": [{
        "iabName": "International News",
        "iabId": "IAB12-1",
        "id": 235,
        "parentIabCatId": "IAB12",
        "pubmaticAdvertiserCategoryId": 12,
        "name": "International News"
    }, {
        "iabName": "National News",
        "iabId": "IAB12-2",
        "id": 236,
        "parentIabCatId": "IAB12",
        "pubmaticAdvertiserCategoryId": 12,
        "name": "National News"
    }, {
        "iabName": "Financial News",
        "iabId": "IAB13-3",
        "id": 241,
        "parentIabCatId": "IAB13",
        "pubmaticAdvertiserCategoryId": 10,
        "name": "Financial News"
    }],
    "publisherSiteSettings": {
        "publisherId": 2685,
        "publisherSiteId": 2686,
        "apiSetting": false,
        "isCoppaCompliant": false,
        "dmEnabled": false,
        "forceSecureAd": 0
    },
    "selectedSiteGroupList": [{
        "id": 1,
        "name": "Standard"
    }, {
        "id": 2,
        "name": "Premium"
    }, {
        "id": 3,
        "name": "RTB"
    }],
    "adTagCount": 47,
    "modificationTime": "1970-01-01 00:00:00",
    "trafficStatus": {
        "id": 2686,
        "impressions": 0,
        "revenue": 0
    }
}

 

 

Retrieving Details of a Site or App

Overview

This API allows you to retrieve the details of a specific site or app using its ID.

Request

         

URI
${URI_PREFIX}/inventorymgmt/publisherSites/{siteId}
 
Note: For sandbox testing, $URI_PREFIX should be replaced with "http://api-sandbox.pubmatic.com/v1".

 

For production, $URI_PREFIX should be replaced with "http://api.pubmatic.com/v1".
HTTP Method
GET

Request Headers

                        

Header Name
Type
Value
Required
Description
Content-Type
application/json
-
Yes
-
Authorization
String
Bearer ${access_token}
Yes
Need to send the access token generating for authentication at the place of ${access_token}.
For more information about access tokens, refer to Getting Started with PubMatic APIs

Request Query Parameters

                 

Parameter
Type
Required
Validations
Description
entityId
Long
Yes
-
ID of the publisher for which the site or app needs to be retrieved.

Sample Request


URL: ${URI_PREFIX}/inventorymgmt/publisherSites/11622?entityId=2685

Response

Response Body

           

Type
Description
site object
JSON response of the site

Sample Response

{
    "siteId": 11622,
    "publisherId": 2685,
    "siteUrl": "http://example.com",
    "monthlyImpressions": 10000000,
    "isDefault": false,
    "platformId": 1,
    "privacyPolicyUrl": "",
    "tldCount": 1,
    "tldCheckEnabled": 0,
    "siteDomain": {
        "siteDomainId": 65207,
        "publisherId": 2685,
        "domainName": "http://example.org"
    },
    "adCategoryList": [],
    "iabPrimaryVerticalList": [{
        "iabName": "Sports",
        "iabId": "IAB17",
        "id": 279,
        "pubmaticAdvertiserCategoryId": 19,
        "name": "Sports"
    }],
    "iabSecondaryVerticalList": [{
        "iabName": "Books & Literature",
        "iabId": "IAB1-1",
        "id": 45,
        "parentIabCatId": "IAB1",
        "pubmaticAdvertiserCategoryId": 8,
        "name": "Books & Literature"
    }],
    "publisherSiteSettings": {
        "publisherId": 2685,
        "publisherSiteId": 11622,
        "apiSetting": false,
        "isCoppaCompliant": false,
        "dmEnabled": false,
        "forceSecureAd": 0
    },
    "selectedSiteGroupList": [{
        "id": 1,
        "name": "Standard"
    }, {
        "id": 2,
        "name": "Premium"
    }, {
        "id": 3,
        "name": "RTB"
    }],
    "adTagCount": 11,
    "modificationTime": "2015-11-19 13:38:35",
    "trafficStatus": {
        "id": 11622,
        "impressions": 0,
        "revenue": 0
    }
}
Error Codes

               

Error CodeError Description
CC01_0002Missing or invalid entityId.Please provide valid entityId .
CC03_0001No records found

 

 

Updating a Site or App

Overview

This API allows you to update the details of an existing site or app.

Request

         

URI
${URI_PREFIX}/inventorymgmt/publisherSites/{id}
 
Note: For sandbox testing, $URI_PREFIX should be replaced with "http://api-sandbox.pubmatic.com/v1".

 

For production, $URI_PREFIX should be replaced with "http://api.pubmatic.com/v1".
HTTP MethodPUT

Request Headers

                        

Header Name
Type
Value
Required
Description
Content-Type
application/json
-
Yes
-
Authorization
String
Bearer ${access_token}
Yes
Need to send the access token generating for authentication at the place of ${access_token}.
For more information about access tokens, refer to Getting Started with PubMatic APIs

Request Query Parameters

                 

Parameter
Type
Required
Validations
Description
entityId
Long
Yes
-
ID of the publisher for which the site or app needs to be updated.

Request Body

                                                                                                     

Body Parameter
Type
Required
Validations
Description
publisherId
Long
Yes
This should be a valid Publisher entity present in the PubMatic platform
ID of the publisher for which the site or app needs to be updated.
siteIdLongYesValid site IDID of the site or app whose details needs to be updated.
siteDomain
Object
Yes
  • This Object is required for adding a new site domain to the system.
  • This domain must be valid and must have a valid HTTP URL.
  • Should be unique.
Domain of the site.
For example,

"siteDomain": {
"publisherId": 2685,
"domainName": "http://example.org"
}
siteUrl
String
Yes
  • This is a mandatory field and must be a valid URL.
  • Should have a unique value and is used for reporting purpose.
  • Must be less than 255 characters
URL of the site used for reporting purposes.
verticalId
Long
Yes
  • Must be one of the valid PubMatic-supported vertical IDs
  • If the publisher account is IAB enabled, then this field is not required.
Vertical/category of the site in case of a non-IAB publisher.
microVerticalId
long
No
  • Must be one of the valid PubMatic-supported micro vertical IDs
  • If the publisher account is IAB enabled, then this field is not required.
Micro vertical/category of the site in case of a non-IAB publisher. It is optional.
platformId
long
Yes
Must be one of the valid PubMatic-supported platform IDs.
 
Platform type of the site. Valid values are:
  • 1 or WEB - Web
  • 2 or MOBILE_WEB - Mobile Web
  • 3 or NOTDEFINED - Not Defined
  • 4 or MOBILE_APP_IOS - Mobile App IOS
  • 5 or MOBILE_APP_ANDROID - Mobile App Android
monthlyImpressions
long
Yes
 
Number of monthly impressions expected by the publisher from this site.
mobileAppProfile
Object
No
In case of an Android or iOS app, this object is required.
 
Details or profile of the mobile app.
  • appStoreUrl indicates the app store URL of the mobile app and is required
    only if the app is available on the app store.
  • isLiveOnAppStore indicates whether the app is already available on the app store
    or not and its value can be "true" or "false".
  • richMediaCompliances indicates the rich media compliance settings of this app and should
  • contain valid values present in system. Valid values for richMediaCompliances are:
    • 3 - MRAID 1.0
    • 4 - ORMMA
    • 5 - MRAID 2.0
  • overridePublisherData indicates whether the publisher-provided app information
    in the ad request
    should override the app details saved in the PubMatic platform or not. It is an
  • optional field.
For example,

"mobileAppProfile": {
"appStoreUrl": "https://itunes.apple.com/us/app/ropenfly-2/id330976703?mt=8",
"isLiveOnAppStore": true,
"richMediaCompliances": [3, 4, 5],
"overridePublisherData": true
}
publisherSiteSettings
Object
No
This object is used to configure the site level settings.
 
Site-specific configuration.
  • apiSetting indicates whether the site should be marked as API in the system or
    not. Valid values
  • are "true" and "false".
  • isCoppaCompliant indicates whether the site is COPPA compliant or not,
    that is, this site/app
  • contains content for children below 13 years of age and the impressions served
    on this site
    should be COPPA-compliant. Valid values are "true" and "false".
  • forceSecureAd indicates whether this site is secure or not. Valid values are "true"
    and "false".

Note: If this site is already mapped to video ad tags, ensure that
this site is marked as API, that is, "apiSetting": true.
For example,

"publisherSiteSettings": {
"publisherId": 2685,
"apiSetting": true,
"isCoppaCompliant": false,
"forceSecureAd": 0
}
iabPrimaryVerticalList
List
No
  • Should contain valid values for primary IAB category supported by the system
  • Currently, only one value should be passed in this list.
Primary IAB category of the site. This parameter is required only if the publisher account is IAB enabled.
iabSecondaryVerticalList
List
No
  • Should contain valid values for secondary IAB categories supported by the  system.
  • User can specify up to 3 values per site.
Secondary IAB category of the site. This parameter is required only if the publisher account is IAB enabled.
privacyPolicyUrl
String
No
 
Privacy Policy URL for the site.

Sample Request for Non-IAB Publisher

URL: ${URI_PREFIX}/inventorymgmt/publisherSites/73833?entityId=24440
Method: PUT
Request Body:
{
    "publisherId": 24440,
    "siteId": 73833,
    "siteDomain": {
        "siteDomainId": 0,
        "publisherId": 24440,
        "domainName": "https://example.org/"
    },
    "siteUrl": "https://example.org//944",
    "platformId": 1,
    "monthlyImpressions": 1000,
    "verticalId": 8,
    "microVerticalId": 33,
    "tldCount": 0,
    "apiSetting": false,
    "publisherSiteSettings": {
        "publisherId": 24440,
        "apiSetting": false,
        "forceSecureAd": 0
    },
    "selectedSiteGroupIds": [
        1,
        3
    ]
}

Sample Request for IAB-enabled Publisher

 

 

URL: ${URI_PREFIX}/inventorymgmt/publisherSites/73834?entityId=2685
Method: PUT
Request Body:
{
    "siteId": 73834,
    "publisherId": 2685,
    "siteDomain": {
        "siteDomainId": 0,
        "publisherId": 2685,
        "domainName": "http://www.espncricinfo.com"
    },
    "siteUrl": "http://www.espncricinfo.com/21132",
    "platformId": 1,
    "monthlyImpressions": 1000,
    "iabPrimaryVerticalList": [{
        "iabId": "IAB23"
    }],
    "iabSecondaryVerticalList": [{
        "iabId": "IAB23-1"
    }, {
        "iabId": "IAB23-2"
    }, {
        "iabId": "IAB23-3"
    }],
    "tldCount": 0,
    "publisherSiteSettings": {
        "publisherId": 2685,
        "apiSetting": true,
        "forceSecureAd": 0
    },
    "selectedSiteGroupIds": [1, 3]
}

Response

Response Body

           

Type
Description
site object
JSON response of the successfully updated site

Sample Response for Non-IAB Publisher


{
    "siteId": 73833,
    "publisherId": 24440,
    "siteUrl": "https://example.org//944",
    "monthlyImpressions": 1000,
    "isDefault": false,
    "verticalId": 8,
    "microVerticalId": 33,
    "tldCheckEnabled": 0,
    "siteDomain": {
        "siteDomainId": 49687,
        "publisherId": 24440,
        "domainName": "https://example.org",
        "deleted": false
    },
    "vertical": {
        "verticalId": 8,
        "name": "Education",
        "id": 8
    },
    "microVertical": {
        "microVerticalId": 33,
        "name": "Sports"
    }
}

Sample Response for an IAB-enabled Publisher


{
    "siteId": 73834,
    "publisherId": 2685,
    "siteUrl": "http://www.example.com/21132",
    "monthlyImpressions": 1000,
    "isDefault": false,
    "tldCheckEnabled": 0,
    "siteDomain": {
        "siteDomainId": 49682,
        "publisherId": 2685,
        "domainName": "http://www.example.com",
        "deleted": false
    },
    "iabPrimaryVerticalList": [{
        "iabName": "Religion & Spirituality",
        "iabId": "IAB23",
        "id": 417,
        "pubmaticAdvertiserCategoryId": 43,
        "name": "Religion & Spirituality"
    }],
    "iabSecondaryVerticalList": [{
        "iabName": "Alternative Religions",
        "iabId": "IAB23-1",
        "id": 418,
        "parentIabCatId": "IAB23",
        "pubmaticAdvertiserCategoryId": 14,
        "name": "Alternative Religions"
    }, {
        "iabName": "Atheism/Agnosticism",
        "iabId": "IAB23-2",
        "id": 419,
        "parentIabCatId": "IAB23",
        "pubmaticAdvertiserCategoryId": 43,
        "name": "Atheism/Agnosticism"
    }, {
        "iabName": "Buddhism",
        "iabId": "IAB23-3",
        "id": 420,
        "parentIabCatId": "IAB23",
        "pubmaticAdvertiserCategoryId": 17,
        "name": "Buddhism"
    }]
}

Error Codes

                               

Error CodeError Description
PUB01_0002
Site already exists
CC01_0002
Missing or invalid {parameter}.Please provide valid {parameter}.
CC01_0002
Domain existence for {siteUrl} could not be verified, that is, the site URL does not exist.
PUBSITE01_04Missing or invalid Platform. Please provide valid Platform.
PUBSITE01_03Missing or invalid {DomainName}. Please provide valid {DomainName}
PUBSITE01_05{param1} cannot be more than {param2}

 

Deleting a Site or App

Overview

This API allows you to delete a specific site or app from the PubMatic platform.

Request

         

URI
${URI_PREFIX}/inventorymgmt/publisherSites/{id}
 
Note: For sandbox testing, $URI_PREFIX should be replaced with "http://api-sandbox.pubmatic.com/v1".

 

For production, $URI_PREFIX should be replaced with "http://api.pubmatic.com/v1".
HTTP Method
DELETE

Request Headers

                        

Header Name
Type
Value
Required
Description
Content-Type
application/json
-
Yes
-
Authorization
String
Bearer ${access_token}
Yes
Need to send the access token generating for authentication at the place of ${access_token}.
For more information about access tokens, refer to Getting Started with PubMatic APIs

Request Query Parameters

                        

Parameter
Type
Required
Validations
Description
entityId
Long
Yes
-
ID of the publisher for which the site or app needs to be deleted.
{id} : PathParamLongYes ID of the site or app which needs to be deleted.

Sample Request


URL: ${URI_PREFIX}/inventorymgmt/publisherSites/73833?entityId=24440

Response

Response Body

           

Type
Description
site object
JSON response of the successfully deleted site

Sample Response


{
    "siteId": 73833,
    "publisherId": 24440,
    "siteUrl": "https://example.org//944",
    "monthlyImpressions": 1000,
    "isDefault": false,
    "platformId": 1,
    "verticalId": 8,
    "microVerticalId": 33,
    "tldCount": 0,
    "tldCheckEnabled": 0,
    "siteDomain": {
        "siteDomainId": 49687,
        "publisherId": 24440,
        "domainName": "https://example.org"
    },
    "adTagCount": 0,
    "modificationTime": "1970-01-01 00:00:00"
}

Error Codes

               

Error CodeError Description
DEFAULT_SITE_DELETE_NOT_ALLOWEDIf a site is marked as default, then its deletion is not allowed
DELETE_ASSOCIATED_AD_TAGSDeletion of site along with associated Ad Tags is not allowed

Attachments

    Outcomes