Preset Management Services (UAS)

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

Description

Targeting presets are used as templates for defining targeting criteria. Modifying an existing preset will not impact line items that have already used this preset. You can save targeting presets (templates), which can be uses at a later point for quickly defining targeting criteria for a new line item. There is a single end-point to configure and save all types of targets in a preset template. 

Supported Operations

Service Name: /presets/

                                             

Method PathHTTP MethodDescriptionLink to Definition
/presets/POSTAdd a new preset templateCreate a Preset
/presets/GETRetrieve a List of PresetsRetrieving a List of Presets
/presets/{id}GETRetrieve the preset details for a specific idRetrieve the Details of a Preset
/presets/{id}PUTUpdate and existing templateUpdate a Preset
/presets/{id}PATCHPerform a partial updates on preset. Using PATCH operations, you can only update name, description and status. Update (Patch) a Preset
/presets/{id}DELETEArchives the preset.Delete a Preset

 

 

Create a Preset

Overview

This API enables you to create a Preset Template.

Request

           

Request Headers

                        

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
pubTokenString${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of ${access_token} in the request.

 

For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

                               

Parameter NameTypeRequiredValidationsDescription
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

    
"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

 

Sample Request URL

https://api.pubmatic.com/v1/uas/presets 

 

Sample JSON Request

Note: 

  1. On 'date' you have to list all targeting types in the request JSON. Add empty targets:[ ]  if that targeting type is not intended. If any targeting is missing in json it will give validation error. This is done for simplicity and consistency with configuration protocol.
  2. API is Transactional, which means that if there is a failure in any of the targeting nothing should be saved.
  3. At a granular level each targeting should contain only the three parameters {targetValue, targetLevel, exclude}. If any extra parameter is preset in the post body during update / create is given, will result in an error. 

    

{
    "account": {
        "id": 118385
    },
    "name": "test preset 1",
    "user": {
        "id": 1
    },
    "status": {
        "id": 1
    },
    "presetTargets": {
        "geo": {
            "targets": [{
                "targetValue": 118205,
                "exclude": false,
                "targetLevel": 3
            }, {
                "targetValue": 4,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceScreenResolution": {
            "targets": []
        },
        "hyperLocal": {
            "targets": []
        },
        "hyperLocalDataSource": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browserLanguage": {
            "targets": [{
                "targetValue": 45,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 97,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceCapability": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "os": {
            "targets": [{
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 94,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 95,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browser": {
            "targets": [{
                "targetValue": 5,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "ipRange": {
            "targets": []
        },
        "inventory": {
            "targets": [{
                "exclude": false,
                "targetLevel": -1,
                "name": "Run of Network"
            }]
        },
        "connectionType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 3,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "device": {
            "targets": [{
                "targetValue": 536,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 556,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "zip": {
            "targets": [{
                "targetValue": {
                    "code": "411038",
                    "countryCode": "IN"
                },
                "exclude": true,
                "targetLevel": 5
            }, {
                "targetValue": {
                    "code": "ai2640",
                    "countryCode": "AI"
                },
                "exclude": false,
                "targetLevel": 5
            }]
        },
        "customKey": {
            "targets": [{
                "targetValue": {
                    "customKey": {
                        "id": 1
                    },
                    "operator": {
                        "id": 1
                    },
                    "customValue": {
                        "value": "Female"
                    },
                    "groupId": 1,
                    "setId": 1
                },
                "exclude": false,
                "targetLevel": 1
            }]
               },
                "audiences":{
                "targets":[]
          }
    }
}

 

To remove all os targeting from preset, give targets [ ] for "os"

 

{
    "account": {
        "id": 118385
    },
    "name": "test preset 1",
    "user": {
        "id": 1
    },
    "status": {
        "id": 1
    },
    "presetTargets": {
        "geo": {
            "targets": [{
                "targetValue": 118205,
                "exclude": false,
                "targetLevel": 3
            }, {
                "targetValue": 4,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceScreenResolution": {
            "targets": []
        },
        "hyperLocal": {
            "targets": []
        },
        "hyperLocalDataSource": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "browserLanguage": {
            "targets": [{
                "targetValue": 45,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 97,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "deviceCapability": {
            "targets": [{
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 6,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "os": {
            "targets": []
        },
        "browser": {
            "targets": [{
                "targetValue": 5,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "ipRange": {
            "targets": []
        },
        "inventory": {
            "targets": [{
                "exclude": false,
                "targetLevel": -1,
                "name": "Run of Network"
            }]
        },
        "connectionType": {
            "targets": [{
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 1,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 3,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "device": {
            "targets": [{
                "targetValue": 536,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 2,
                "exclude": false,
                "targetLevel": 1
            }, {
                "targetValue": 556,
                "exclude": false,
                "targetLevel": 1
            }]
        },
        "zip": {
            "targets": [{
                "targetValue": {
                    "code": "411038",
                    "countryCode": "IN"
                },
                "exclude": true,
                "targetLevel": 5
            }, {
                "targetValue": {
                    "code": "ai2640",
                    "countryCode": "AI"
                },
                "exclude": false,
                "targetLevel": 5
            }]
        },
        "customKey": {
            "targets": [{
                "targetValue": {
                    "customKey": {
                        "id": 1
                    },
                    "operator": {
                        "id": 1
                    },
                    "customValue": {
                        "value": "Female"
                    },
                    "groupId": 1,
                    "setId": 1
                },
                    "exclude": false,
                    "targetLevel": 1
            }]
        },
                    "audiences":{
                    "targets":[]
        }
    }
}

Response

Sample Response JSON

{
  "presetTargets": {
    "geo": {
      "targets": [
        {
          "targetValue": 118205,
          "exclude": false,
          "targetLevel": 3,
          "countryCode": "US",
          "regionCode": "MI",
          "cityName": "Eckerman",
          "name": "Eckerman"
        },
        {
          "targetValue": 4,
          "exclude": false,
          "targetLevel": 1,
          "countryCode": "AE",
          "name": "United Arab Emirates"
        }
      ]
    },
    "deviceType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 2,
          "deviceType": "Smart Phone"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 1,
          "deviceType": "Feature Phone"
        }
      ]
    },
    "deviceScreenResolution": {
      "targets": []
    },
    "hyperLocal": {
      "targets": []
    },
    "hyperLocalDataSource": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "browserLanguage": {
      "targets": [
        {
          "targetValue": 45,
          "exclude": false,
          "targetLevel": 1,
          "name": "Armenian"
        },
        {
          "targetValue": 97,
          "exclude": false,
          "targetLevel": 1,
          "name": "Albanian"
        }
      ]
    },
    "deviceCapability": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 1,
          "deviceCapabilityName": "Phone calls"
        },
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 6,
          "deviceCapabilityName": "NFC support"
        }
      ]
    },
    "os": {
      "targets": []
    },
    "browser": {
      "targets": [
        {
          "targetValue": 5,
          "exclude": false,
          "targetLevel": 1,
          "name": "Chrome"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "Firefox"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "IE"
        }
      ]
    },
    "ipRange": {
      "targets": []
    },
    "inventory": {
      "targets": [
        {
          "exclude": false,
          "targetLevel": -1,
          "name": "Run of Network"
        }
      ]
    },
    "connectionType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "WiFi"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "Cellular"
        },
        {
          "targetValue": 3,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "device": {
      "targets": [
        {
          "targetValue": 536,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Asus",
          "make": "Asus"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Apple",
          "make": "Apple"
        },
        {
          "targetValue": 556,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Barnes and Noble",
          "make": "Barnes and Noble"
        }
      ]
    },
    "zip": {
      "targets": [
        {
          "targetValue": {
            "code": "411038",
            "countryCode": "IN"
          },
          "exclude": true,
          "targetLevel": 5,
          "country": "India",
          "regionName": "Maharashtra",
          "city": "Pune",
          "code": "411038",
          "countryCode": "IN"
        },
        {
          "targetValue": {
            "code": "ai2640",
            "countryCode": "AI"
          },
          "exclude": false,
          "targetLevel": 5,
          "country": "Anguilla",
          "regionName": "Anguilla",
          "city": "The Valley",
          "code": "ai2640",
          "countryCode": "AI"
        }
      ]
    },
    "customKey": {
      "targets": [
        {
          "targetValue": {
            "customKey": {
              "id": 1,
              "name": "Gender",
              "status": {
                "id": 1
              }
            },
            "operator": {
              "id": 1,
              "name": "IS"
            },
            "customValue": {
              "value": "Female"
            },
            "groupId": 1,
            "setId": 1
          },
           "exclude": false,
          "targetLevel": 1
        }
      ]
    },
          "audiences":{
          "targets":[]
    }
  },
          "account": {
          "id": 118385,
          "name": "Account 118385"
  },
          "id": 1654,
          "user": {
          "id": 18321
  },
          "status": {
          "id": 1,
          "name": "Active"
  },
         "name": "test preset 1"
}

 

 Retrieving a List of Presets

Overview

This API enables you to retrieve a list of Presets.

Request

           

Request Headers

                        

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
pubTokenString${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of ${access_token} in the request.

 

For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

                               

Parameter NameTypeRequiredValidationsDescription
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

    
"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

 

Sample Request URL

https://api.pubmatic.com/v1/uas/presets/

Response

Sample Response JSON

{
    "metaData": {
        "startIndex": 1,
        "totalRecords": 3,
        "endIndex": 3
    },
    "items": [
        {
            "status": {
                "id": 1,
                "name": "Active",
                "url": "http://api.pubmatic.com/v1/uas/status/1"
            },
            "account": {
                "id": 118385,
                "name": "PubMatic Inc.",
                "url": "http://api.pubmatic.com/v1/uas/accounts/1"
            },
            "id": 274,
            "name": "test preset 1",
            "isPreset": 1,
            "user": {
                "id": 1,
                "name": "AdOps One",
                "url": "http://api.pubmatic.com/v1/uas/users/1"
            }
        },
        {
            "status": {
                "id": 1,
                "name": "Active",
                "url": "http://api.pubmatic.com/v1/uas/status/1"
            },
            "account": {
                "id": 1,
                "name": "PubMatic Inc.",
                "url": "http://api.pubmatic.com/v1/uas/accounts/1"
            },
            "id": 276,
            "name": "test preset 2",
            "isPreset": 1,
            "user": {
                "id": 1,
                "name": "AdOps One",
                "url": "http://api.pubmatic.com/v1/uas/users/1"
            }
        },
        {
            "status": {
                "id": 1,
                "name": "Active",
                "url": "http://api.pubmatic.com/v1/uas/status/1"
            },
            "account": {
                "id": 118385,
                "name": "PubMatic Inc.",
                "url": "http://api.pubmatic.com/v1/uas/accounts/1"
            },
            "id": 277,
            "name": "test preset 3",
            "isPreset": 1,
            "user": {
                "id": 1,
                "name": "AdOps One",
                "url": "http://api.pubmatic.com/v1/uas/users/1"
            }
        }
    ]
}

Retrieve the Details of a Preset

Overview

This API enables you to retrieve the details for a Preset Template.

Request

Request Headers

                        

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
pubTokenString${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of ${access_token} in the request.

 

For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

                               

Parameter NameTypeRequiredValidationsDescription
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

    
"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }
       ]
   }

 

Sample Request URL

https://api.pubmatic.com/v1/uas/presets/1654 

Response

Sample Response JSON

 

{
  "presetTargets": {
    "deviceType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 2,
          "deviceType": "Smart Phone"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 1,
          "deviceType": "Feature Phone"
        }
      ]
    },
    "zip": {
      "targets": [
        {
          "targetValue": {
            "code": "411038",
            "countryCode": "IN"
          },
          "exclude": true,
          "targetLevel": 5,
          "country": "India",
          "regionName": "Maharashtra",
          "city": "Pune",
          "code": "411038",
          "countryCode": "IN"
        },
        {
          "targetValue": {
            "code": "ai2640",
            "countryCode": "AI"
          },
          "exclude": false,
          "targetLevel": 5,
          "country": "Anguilla",
          "regionName": "Anguilla",
          "city": "The Valley",
          "code": "ai2640",
          "countryCode": "AI"
        }
      ]
    },
    "customKey": {
      "targets": [
        {
          "targetValue": {
            "customKey": {
              "id": 1,
              "name": "Gender",
              "status": {
                "id": 1
              }
            },
            "operator": {
              "id": 1,
              "name": "IS"
            },
            "customValue": {
              "value": "Female"
            },
            "groupId": 1,
            "setId": 1
          },
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "browserLanguage": {
      "targets": [
        {
          "targetValue": 45,
          "exclude": false,
          "name": "Armenian"
        },
        {
          "targetValue": 97,
          "exclude": false,
          "name": "Albanian"
        }
      ]
    },
    "deviceCapability": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 1,
          "deviceCapabilityName": "Phone calls"
        },
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "deviceCapabilityId": 6,
          "deviceCapabilityName": "NFC support"
        }
      ]
    },
    "os": {
      "targets": [
        {
          "targetValue": 6,
          "exclude": false,
          "targetLevel": 1,
          "osTypeId": 1,
          "osName": "iOS"
        },
        {
          "targetValue": 94,
          "exclude": false,
          "targetLevel": 2,
          "osTypeId": 2,
          "osName": "Android 2.2",
          "verMajor": "2.2"
        },
        {
          "targetValue": 95,
          "exclude": false,
          "targetLevel": 2,
          "osTypeId": 14,
          "osName": "Bada OS 1.2",
          "verMajor": "1.2"
        }
      ]
    },
    "deviceScreenResolution": {
      "targets": []
    },
    "hyperLocalDataSource": {
      "targets": [
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1
        }
      ]
    },
    "ipRange": {
      "targets": []
    },
    "inventory": {
      "targets": [
        {
          "exclude": false,
          "targetLevel": -1,
          "name": "Run of Network"
        }
      ]
    },
    "connectionType": {
      "targets": [
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "name": "WiFi"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "targetLevel": 1,
          "name": "Cellular"
        },
        {
          "targetValue": 3,
          "exclude": false
        }
      ]
    },
    "hyperLocal": {
      "targets": []
    },
    "geo": {
      "targets": [
        {
          "targetValue": 118205,
          "exclude": false,
          "targetLevel": 3,
          "countryCode": "US",
          "regionCode": "MI",
          "cityName": "Eckerman",
          "name": "Eckerman"
        },
        {
          "targetValue": 4,
          "exclude": false,
          "targetLevel": 1,
          "countryCode": "AE",
          "name": "United Arab Emirates"
        }
      ]
    },
    "browser": {
      "targets": [
        {
          "targetValue": 5,
          "exclude": false,
          "name": "Chrome"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "name": "Firefox"
        },
        {
          "targetValue": 1,
          "exclude": false,
          "name": "IE"
        }
      ]
    },
    "device": {
      "targets": [
        {
          "targetValue": 536,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Asus",
          "make": "Asus"
        },
        {
          "targetValue": 2,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Apple",
          "make": "Apple"
        },
        {
          "targetValue": 556,
          "exclude": false,
          "targetLevel": 1,
          "deviceTypeId": 3,
          "deviceValue": "Barnes and Noble",
          "make": "Barnes and Noble"
        }
      ]
     },
    "audiences":{
        "targets":[]
    }
  },

  },
  "account": {
    "id": 118385,
    "name": "Account 118385 (Phoenix Beta)"
  },
  "id": 1654,
  "user": {
    "id": 18321
  },
  "status": {
    "id": 1,
    "name": "Active"
  },
  "name": "test preset 1"
}

Update a Preset

Overview 

This API enables you to update an existing Preset Template.

Request

           

Request Headers

                        

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
pubTokenString${access_token}Yes

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of ${access_token} in the request.

 

For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters

This API accepts mapping of all existing targeting objects, where each object must contain a valid individual targeting criteria. Other than the target objects, preset as an entity contains information such as account, name, user, etc.

                               

Parameter NameTypeRequiredValidationsDescription
accountIntegerYes

Account of publisher for which the Line Item is created

Account of the Publisher

nameStringYes

Should be unique for a given account

Can be a maximum 255 characters consisting of letters, numbers, dashes, hyphens, periods, asterisks and colons.

Preset Name
presetTargetsMapYesValues = valid target entity for the given key containing a list of targets.

Key set: "geo","os", "connectionType", "deviceType", "device", "deviceCapability", "browser", "browserLanguage", "inventory", "ipRange", "deviceScreenResolution", "hyperLocal", "hyperLocalDataSource", "zip", "customKey", "audiences"

e.g.  

    
"geo": {
       "targets": [
           {
               "targetValue": 118205,
               "exclude": false,
               "targetLevel": 3
           },
           {
               "targetValue": 118206,
               "exclude": false,
               "targetLevel": 3
           }