Browser Language Targeting (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

PubMatic AdServer Browser Language Targeting API is used for targeting browser languages for a Line Item.

Important Note:

  1. This API will not validate targetValue  ( i.e. id's for respective targeting ) provided in the POST call.  Users should retrieve the valid target details using the Common Browser Language API and provide id's for respective targeting.
  2. Make sure that same targetValues are not getting included / excluded at same time for same line item.

For more information about UAS Line Item Targeting Services, refer to Line Item Targeting Services (UAS)

Supported Operations 

                     

Method PathHTTP MethodDescriptionLink to Definition
/lineitems/{lineItemId}/targets/browswerlanguagesPOSTAdd/Update/Remove Browser LanguageTargeting for the Line ItemConfigure Language Targeting
/lineitems/{lineItemId}/targets/browswerlanguagesGETRetrieve Browser Language Details for a Line ItemRetrieve Targeted Browser Languages for a Line Item

 

Configure Language Targeting

 

Overview

This API enables you to add, update or remove Browser Language Targeting for a Line Item.

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

                               

Parameter NameTypeRequiredValidationsDescriptions
targetLevelNumericYes

Should not be null.

Should not be empty.

Browser language does not have a hierarchy and therefore, the targetLevel will be always 1.

               
Target LevelTargetDescriptionURL for obtaining target level list
1Browser LanguageBrowser Language for Targeting

You can retrieve the supported browser languages for targeting using following link. You can apply sorting on supported dimensions.

http://$URI_PREFIX/api/common/browserlanguage?dimensions=id,name&showAll=true&sort=name

targetValueNumeric

Yes

Should not be null.

Should not be empty.

Target Value can contain the actual or reference value. It will depend on which target level you are targeting for.

e.g. If you want to target for browser language English then targetValue = 23
 

The following are supported data types:

             
Target TypeTarget Value Data TypeReference/Actual Value
Browser LanguageNumericReference Value.  id attribute from the response returned by Common API
excludeBooleanYes

Default will be false.

Valid values can be true or false.

This value indicates whether the browser language to be included / excluded while targeting the Line Item

You can either include or exclude the entities during targeting for given line time for entities at same level. E.g. You can either include or exclude the browsers but not both at time.

Sample Request URL

https://api.pubmatic.com/v1/uas/lineitems/{lineItemId}/targets/browserlanguages/

Sample Request JSON

{
    "targets": [{
        "targetValue": 23,
        "targetLevel": 1,
        "exclude": true
    }, {
        "targetValue": 32,
        "targetLevel": 1,
        "exclude": true
    }, {
        "targetValue": 21,
        "targetLevel": 1,
        "exclude": true
    }]
}

To remove all browser language targeting for a line item:

    

{
    "targets": []
}

Response

Sample Response JSON

    

{
    "entity": {
        "id": {targetid associated with lineitem},
        "isPreset": 0
    },
    "targets": [{
        "targetValue": 23,
        "exclude": true,
        "targetLevel": 1,
        "name": "English"
    }, {
        "targetValue": 32,
        "exclude": true,
        "targetLevel": 1,
        "name": "French"
    }, {
        "targetValue": 21,
        "exclude": true,
        "targetLevel": 1,
        "name": "German"
    }]
}

 

Retrieve Targeted Browser Languages for a Line Item

 

Overview

This API enables you to retrieve Browser Language details for a Line Item.

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

                               

Parameter NameTypeRequiredValidationsDescriptions
targetLevelNumericYes

Should not be null.

Should not be empty.

Browser language does not have a hierarchy and therefore, the targetLevel will be always 1.

               
Target LevelTargetDescriptionURL for obtaining target level list
1Browser LanguageBrowser Language for Targeting

You can retrieve the supported browser languages for targeting using following link. You can apply sorting on supported dimensions.

http://$URI_PREFIX/api/common/browserlanguage?dimensions=id,name&showAll=true&sort=name

targetValueNumeric

Yes

Should not be null.

Should not be empty.

Target Value can contain the actual or reference value. It will depend on which target level you are targeting for.

e.g. If you want to target for browser language English then targetValue = 23
 

The following are supported data types:

             
Target TypeTarget Value Data TypeReference/Actual Value
Browser LanguageNumericReference Value.  id attribute from the response returned by Common API
excludeBooleanYes

Default will be false.

Valid values can be true or false.

This value indicates whether the browser language to be included / excluded while targeting the Line Item

You can either include or exclude the entities during targeting for given line time for entities at same level. E.g. You can either include or exclude the browsers but not both at time.

Sample Request URL

https://api.pubmatic.com/v1/uas/lineitems/{lineItemId}/targets/browserlanguages/

Response

Sample Response JSON

 {
    "targets":
    [
        {
            "targetValue": 23,
            "exclude": true,
            "name": "English"
        },
        {
            "targetValue": 32,
            "exclude": true,
            "name": "French"
        },
        {
            "targetValue": 21,
            "exclude": true,
            "name": "German"
        }
    ]
}

Error Codes for Browser LanguageTargeting

Error codes will be displayed with row information. Row indicates the order of the target object in the request

                                 

Sr. NoError CodesError MessageDescription
1PH_ACCESS_DENIEDAccess DeniedWhen the lineitemid provided does not exist or you don't have access to a line item to perform the edit operation.
2PH_MISSING_OR_INVALID_PARAMETERMissing or Invalid Target ValueWhen any target object contains NULL or an empty target value
3PH_MISSING_OR_INVALID_PARAMETERMissing or Invalid entity id [id] When an invalid Line Item Id is provided in the request
4PH_DUPLICATE_ENTRIES_FOUNDDuplicate targets targetValue [id]When any targetValue is duplicated during the POST request
 

Unified Ad Server References

Common Request Query Parameters for Web Services

Supported Operations for Filters

HTTP Status Codes

Unified Ad Server Specific Error Codes

 

Version 0.1

Attachments

    Outcomes