Connection Type Targeting (UAS)

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

Description

Use the Connection Type Targeting API to target the line items on Mobile devices with a specific connection type.  

Important Note:

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

This API must be called after creating/updating Line Item successfully since it require lineitemId during targeting.

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/connectiontypesPOSTAdd/Update/Remove Connection Type Targeting for the Line ItemConfigure Connection Type Targeting
/lineitems/{lineItemId}/targets/connectiontypesGETRetrieve Connection Type Targeting Details for a Line ItemRetrieve Targeted Connection Types for a Line Item

 

Configure Connection Type Targeting

Overview

This API enables you to add, update or remove Connection Types 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

This API accepts array of target objects, where each object must contain following attributes

                               

Parameter NameTypeRequiredValidationsDescriptions
targetLevelNumericYes

Should not be null.

Should not be empty.

This API allows you to target Connection Types. It does not have any hierarchical relation Hence the targetLevel will be always 1.

               
Target LevelTargetDescriptionURL for obtaining target level list
1Connection TypeConnection Type Targeting

http://$URI_PREFIX/api/common/pmconnectiontype

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.

e.g., if you want to target for connection type WiFi then targetValue=2

The following are supported data types:

             
Target TypeTarget Value Data TypeReference/Actual Value
Connection TypeNumericReference Value.  id attribute from the response returned byhttp://$URI_PREFIX/api/common/pmconnectiontype
excludeBooleanYes

Default will be false.

Valid values can be true or false.

This value indicates whether the browser is 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 Connection Type but not both at the same time.

Sample Request URL

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

Sample Request JSON

Targeting on WiFi only

    

{
    "targets": [
        {
            "targetLevel": 1,
            "targetValue": 2,
            "exclude": false
        }
    ]
}

Sample Request JSON: To Remove all Connection Types for a Line Item

{
    "targets": [ ]
}

 

Response 

Sample Response JSON

    

{
    "entity": {
        "id": {targetid associated with lineitem},
        "isPreset": 0
    },
    "targets": [{
        "targetValue": 2,
        "exclude": false,
        "targetLevel": 1,
        "name": "WiFi"
    }]
}

Retrieve Targeted Connection Types for a Line Item

 

Overview

This API enables you to retrieve Connection Types for a Line Item.

Request

           

URIHTTP Method
https://api.pubmatic.com/v1/uas/lineitems/{lineItemId}/targets/connectiontypes/GET

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 array of target objects, where each object must contain following attributes

                               

Parameter NameTypeRequiredValidationsDescriptions
targetLevelNumericYes

Should not be null.

Should not be empty.

This API allows you to target Connection Types. It does not have any hierarchical relation Hence the targetLevel will be always 1.

               
Target LevelTargetDescriptionURL for obtaining target level list
1Connection TypeConnection Type Targeting

http://$URI_PREFIX/api/common/pmconnectiontype

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.

e.g., if you want to target for connection type WiFi then targetValue=2

The following are supported data types:

             
Target TypeTarget Value Data TypeReference/Actual Value
Connection TypeNumericReference Value.  id attribute from the response returned by http://$URI_PREFIX/api/common/pmconnectiontype
excludeBooleanYes

Default will be false.

Valid values can be true or false.

This value indicates whether the browser is 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 Connection Type but not both at the same time.

Sample Request URL

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

Response

Sample Response JSON

    

 {
    "targets": [{
        "targetValue": 2,
        "exclude": false,
        "targetLevel": 1,
        "name": "WiFi"
    }]
}

 

Error Codes for Connection Types

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