Description

The Native Ads API manages operations related to Native Ad configuration.

Workflow for Creating Native AdTag

There are three main steps in Native AdTag configuration (shown in workflow below). 

  1. Configure the the required assets for the native adslot and create native configuration in the system.
  2. Configure other AdTag configuration details such as name and passback.
  3. Create the AdTag and map the native configuration with this AdTag.

In this workflow, information regarding the templates, asset types, ad units, and mime types are obtained through the Native API.  Native configuration is created using the Native API. AdTag creation will take native configuration information as input and create Native AdTag

NativeAds API Features

  • API to fetch MimeTypes for Native ads
  • Operations related to native templates
  • API to fetch native ad unit types for Native ads
  • API to fetch Native asset types and sub types
  • Operations related to native configurations for AdTag
  • API to Get HTML using crawling for sites
  • API to fetch Native Image Sizes

Methods

Method Path HTTP Method Type Description Link to Definition
/mimetype GET

The API method gets different mime types for Image and Video Asset

e.g image/png, image/jpeg

Get Mime Type
/nativetemplate  GET

The API method gets standard layout information available for configuring AdTag by Id. Response includes different assets which are associated with the layout. E,g Content Wall Layout (id =2 

Get Template By Id
/nativetemplate  GET

The API method gets different standard layouts available for configuring AdTag. Response includes different assets which are associated with the layouts.

Get Template
/nativeadunit GET The API method getss different standard IAB native adunit information for configuring AdTag. e.g Paid Search Units, Recommendation Widgets etc  Get NativeAdUnit
/nativeassetsubtype GET
The API method is gets different standard asset subtypes available for configuring AdTag. For example for Image Asset type, different subtypes are Main, Icon and Logo. 
Get Native SubType
/nativeassettype GET
The API method gets different standard asset Types available for configuring AdTag. For example title, Image, Data and Video. 
Get Native Type
/nativeassettype/properties GET
The API method gets different properties which are required to be configured for a particular asset type. For e.g for data asset type length needs to be configured. 
Get List of Properties
/nativeconfig GET
The API method gets the complete native configuration which is saved in system. It will give information regarding all assets which were configured and corresponding properties as well. 
Get Native Adtag Configs
/native/config/{id} GET
The API method gets the complete native configuration which is saved in system for a given Id. It will give information regarding all assets which were configured and corresponding properties as well. 
Get Details of Native Configs
/nativeconfig POST
The API method creates native configuration in system. It will need all info related to assets and corresponding properties. 
Create Native Config
/nativeconfig PUT
The API method updates native configuration in system. 
Edit Native Configs
/nativeconfig PUT
The API method updates the  HTML template for a given native configuration in system. HTML template is the html code for a given adslot of publisher page where native ad needs to be rendered. This template holds macros for different assets which needs to be populated during adserving. 
Update Native HTML Template
/nativeimagesize GET The API method gets different sizes applicable for image assets. Native Image Size

 

Get Mime Type

This API is used to retrieve the valid mime types for video and image assets.

Request

URI ${URI_PREFIX}/nativeads/mimetype
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Sample Request/Response

1. Get Image Mime Types

http://localhost:8080/nativeads/mimetype?filters=type+like+image

 

{

"metaData": {
"startIndex": 1,
"totalRecords": 4,
"endIndex": 4
},
"items": [
{
"id": 1,
"type": "image",
"name": "image/png"
},
{
"id": 2,
"type": "image",
"name": "image/jpeg"
},
{
"id": 3,
"type": "image",
"name": "image/gif"
},
{
"id": 4,
"type": "image",
"name": "image/tiff"
}
]
}

2. Get Video Mime Types

http://localhost:8080/nativeads/mimetype?filters=type+like+image

{
"metaData": {
"startIndex": 1,
"totalRecords": 7,
"endIndex": 7
},
"items": [
{
"id": 5,
"type": "video",
"name": "video/mp4"
},
{
"id": 6,
"type": "video",
"name": "application/x-shockwave-flash"
},
{
"id": 7,
"type": "video",
"name": "video/x-ms-wmv"
},
{
"id": 8,
"type": "video",
"name": "video/h264"
},
{
"id": 9,
"type": "video",
"name": "video/webm"
},
{
"id": 10,
"type": "video",
"name": "application/javascript"
},
{
"id": 11,
"type": "video",
"name": "video/ogg"
}
]
}

Response Body

Response Body Parameter Type Description
id Integer Id of the mime type in PubMatic system
type String Tpe of mime type. e.g., image, video
name String Name of the mime type

Get Template by ID

This API fetches the native template information for a given native template Id. Native Template Id needs to be passed as the path parameter.

Request

Request

URI ${URI_PREFIX}/nativeads/nativetemplate/{id}
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

 

Path Parameters

Parameter Name Type Required Default Possible Values Description Sample Data
id Integer Yes     Template Id whose information needs to be read.  2

 

Response Body

Response Body Parameter Type Description
Id Integer Id of the layout/template
name String Name of the layout/template
description String Short description about the layout/template
nativeAttributes Array Native attributes array, which can be configured for this layout/template
nativeAttributes.name String Name of asset attribute
nativeAttributes.description String Description of the asset attribute
nativeAttributes.typeId Integer Asset attribute Type Id in the system
nativeAttributes.subTypeId Integer Asset attribute subtype Id in the system. It will not be present if the asset attribute is a parent type and doesn't have subtypes.

Sample Request/Response JSON 

Sample URL: http://localhost:8080/nativeads/nativetemplate/4

Response

{
  "id": 4,
  "name": "News Feed",
  "description": "News Feed - Native Template",
  "nativeAttributes": [
    {
      "name": "title",
      "description": "Title object for title assets",
      "typeId": 1
    },
    {
      "name": "icon",
      "description": "Image object for image assets",
      "typeId": 2,
      "subTypeId": 1
    },
    {
      "name": "ctatext",
      "description": "Data object for data assets",
      "typeId": 3,
      "subTypeId": 12
    },
    {
      "name": "rating",
      "description": "Data object for data assets",
      "typeId": 3,
      "subTypeId": 3
    }
  ]
}

 

List Templates

Overview

This API lists all the available standard layout/templates for native adserving.

Request

Request

URI $URI_PREFIX/nativeads/templates
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

 

Response Body

Response Body Parameter Type Description
Id Integer Id of the layout/template
name String Name of the layout/template
description String Short description about the layout/template
nativeAttributes Array Native attributes array, which can be configured for this layout/template
nativeAttributes.name String Name of asset attribute
nativeAttributes.description String Description of the asset attribute
nativeAttributes.typeId Integer Asset attribute Type Id in the system
nativeAttributes.subTypeId Integer Asset attribute subtype Id in the system. It will not be present if the asset attribute is a parent type and doesn't have subtypes.

Sample Request/Response JSON 

Sample URL: http://localhost:8080/nativeads/nativetemplate/

Response

{
  "metaData": {
    "startIndex": 1,
    "totalRecords": 7,
    "endIndex": 7
  },
  "items": [
    {
      "id": 1,
      "name": "Custom",
      "description": "Custom Template. User can manually select properties",
      "nativeAttributes": [
        {
          "name": "price",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 6
        },
        {
          "name": "sponsored",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 1
        },
        {
          "name": "video",
          "description": "Video object for video asset",
          "typeId": 4
        },
        {
          "name": "phone",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 8
        },
        {
          "name": "rating",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 3
        },
        {
          "name": "icon",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 1
        },
        {
          "name": "desc2",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 10
        },
        {
          "name": "downloads",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 5
        },
        {
          "name": "main",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 3
        },
        {
          "name": "ctatext",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 12
        },
        {
          "name": "saleprice",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 7
        },
        {
          "name": "desc",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 2
        },
        {
          "name": "address",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 9
        },
        {
          "name": "likes",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 4
        },
        {
          "name": "logo",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 2
        },
        {
          "name": "displayurl",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 11
        },
        {
          "name": "title",
          "description": "Title object for title assets",
          "typeId": 1
        }
      ]
    },
    {
      "id": 2,
      "name": "Content Wall",
      "description": "Content Wall - Native Template",
      "nativeAttributes": [
        {
          "name": "main",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 3
        }
      ]
    },
    {
      "id": 3,
      "name": "App Wall",
      "description": "App Wall - Native Template",
      "nativeAttributes": [
        {
          "name": "title",
          "description": "Title object for title assets",
          "typeId": 1
        },
        {
          "name": "ctatext",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 12
        },
        {
          "name": "icon",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 1
        },
        {
          "name": "rating",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 3
        }
      ]
    },
    {
      "id": 4,
      "name": "News Feed",
      "description": "News Feed - Native Template",
      "nativeAttributes": [
        {
          "name": "ctatext",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 12
        },
        {
          "name": "title",
          "description": "Title object for title assets",
          "typeId": 1
        },
        {
          "name": "icon",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 1
        },
        {
          "name": "rating",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 3
        }
      ]
    },
    {
      "id": 5,
      "name": "Chat List",
      "description": "Chat List - Native Template",
      "nativeAttributes": [
        {
          "name": "title",
          "description": "Title object for title assets",
          "typeId": 1
        },
        {
          "name": "icon",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 1
        },
        {
          "name": "desc",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 2
        }
      ]
    },
    {
      "id": 6,
      "name": "Carousel",
      "description": "Carousel - Native Template",
      "nativeAttributes": [
        {
          "name": "desc",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 2
        },
        {
          "name": "icon",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 1
        },
        {
          "name": "rating",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 3
        },
        {
          "name": "title",
          "description": "Title object for title assets",
          "typeId": 1
        },
        {
          "name": "main",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 3
        }
      ]
    },
    {
      "id": 7,
      "name": "Content Stream",
      "description": "Content Stream - Native Template",
      "nativeAttributes": [
        {
          "name": "main",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 3
        },
        {
          "name": "desc",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 2
        },
        {
          "name": "title",
          "description": "Title object for title assets",
          "typeId": 1
        },
        {
          "name": "rating",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 3
        },
        {
          "name": "icon",
          "description": "Image object for image assets",
          "typeId": 2,
          "subTypeId": 1
        },
        {
          "name": "ctatext",
          "description": "Data object for data assets",
          "typeId": 3,
          "subTypeId": 12
        }
      ]
    }
  ]
}

Get List of AdUnits

This API retrieves a list of all available Ad Units for Native Ad Serving.

Request

URI $URI_PREFIX/nativeads/nativeadunit/
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Response Body

Response Body Parameter Type Description
description String Short description about the layout/template
name String Name of the layout/template
Id Integer Id of the layout/template

Sample Request/Response JSON 

Sample URL: http://localhost:8080/nativeads/nativeadunit/

Response

{
  "metaData": {
    "startIndex": 1,
    "totalRecords": 5,
    "endIndex": 5
  },
  "items": [
    {
      "description": "Paid Search Unit - Native AdUnit",
      "name": "Paid Search Units",
      "id": 1
    },
    {
      "description": "Recommendation Widgets - Native AdUnit",
      "name": "Recommendation Widgets",
      "id": 2
    },
    {
      "description": "Promoted Listings - Native AdUnit",
      "name": "Promoted Listings",
      "id": 3
    },
    {
      "description": "In-Ad (IAB Standard) with Native Element Unit",
      "name": "In-Ad",
      "id": 4
    },
    {
      "description": "Custom - Native AdUnit",
      "name": "Custom",
      "id": 5
    }
  ]
}

Get Native Subtypes

This API is used to get the valid mime types for video and image asset.

Request

URI ${URI_PREFIX}/nativeads/nativeassetsubtype/
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Sample Request/Response

Sample URL: http://localhost:8080/nativeads/nativeassetsubtype/

Response

{
  "metaData": {
    "startIndex": 1,
    "totalRecords": 15,
    "endIndex": 15
  },
  "items": [
    {
      "id": 1,
      "typeId": 2,
      "subTypeId": 1,
      "name": "icon",
      "description": "Icon image"
    },
    {
      "id": 2,
      "typeId": 2,
      "subTypeId": 2,
      "name": "logo",
      "description": "Logo image for brand/app"
    },
    {
      "id": 3,
      "typeId": 2,
      "subTypeId": 3,
      "name": "main",
      "description": "Large image preview for ad"
    },
    {
      "id": 4,
      "typeId": 3,
      "subTypeId": 1,
      "name": "sponsored",
      "description": "Sponsored By message"
    },
    {
      "id": 5,
      "typeId": 3,
      "subTypeId": 2,
      "name": "desc",
      "description": "Descriptive text for product"
    },
    {
      "id": 6,
      "typeId": 3,
      "subTypeId": 3,
      "name": "rating",
      "description": "Rating of the product"
    },
    {
      "id": 7,
      "typeId": 3,
      "subTypeId": 4,
      "name": "likes",
      "description": "Number of social likes"
    },
    {
      "id": 8,
      "typeId": 3,
      "subTypeId": 5,
      "name": "downloads",
      "description": "Number downloads"
    },
    {
      "id": 9,
      "typeId": 3,
      "subTypeId": 6,
      "name": "price",
      "description": "Price for product"
    },
    {
      "id": 10,
      "typeId": 3,
      "subTypeId": 7,
      "name": "saleprice",
      "description": "Sale price of product"
    },
    {
      "id": 11,
      "typeId": 3,
      "subTypeId": 8,
      "name": "phone",
      "description": "Phone number"
    },
    {
      "id": 12,
      "typeId": 3,
      "subTypeId": 9,
      "name": "address",
      "description": "Address"
    },
    {
      "id": 13,
      "typeId": 3,
      "subTypeId": 10,
      "name": "desc2",
      "description": "Additional descriptive text"
    },
    {
      "id": 14,
      "typeId": 3,
      "subTypeId": 11,
      "name": "displayurl",
      "description": "Display URL for the text ad"
    },
    {
      "id": 15,
      "typeId": 3,
      "subTypeId": 12,
      "name": "ctatext",
      "description": "Text for call to action button"
    }
  ]
}

Get Asset Types

Overview

This API fetches the Asset Types, i.e., top-level asset type listing available for configuration.

Request

URI ${URI_PREFIX}/nativeads/nativeassettype/
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Response Body

Response Body Parameter Type Description
Id Integer Native Asset Type Id
name String Name of the Native Asset Type
description String Description of Native Asset Type

Sample URL: http://localhost:8080/nativeads/nativeassettype

Response

{
  "metaData": {
    "startIndex": 1,
    "totalRecords": 4,
    "endIndex": 4
  },
  "items": [
    {
      "id": 1,
      "name": "title",
      "description": "Title object for title assets"
    },
    {
      "id": 2,
      "name": "image",
      "description": "Image object for image assets"
    },
    {
      "id": 3,
      "name": "data",
      "description": "Data object for data assets"
    },
    {
      "id": 4,
      "name": "video",
      "description": "Video object for video asset"
    }
  ]
}

Get List of Properties

Overview

This API method gets different properties that are required to be configured for a particular asset type. For example, for data asset type, the length needs to be configured.

Request

URI ${URI_PREFIX}/nativeads/nativeassettype/properties
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Response Body

Response Body Parameter Type Description
Id Integer ID of the Native Asset Property
name String Native Asset Property Name
typeId Integer Type ID of the Native Asset for which the property applies
type String Type of the Native Asset for which the property is applicable
required Boolean This field defines whether the parameter is a mandatory parameter or not
defaultValue String Default value of the property that will be considered if not provided by user during configuration.
displayName String Field name that will be displayed on PubMatic UI. This is for UI purposes only.

Sample Request/ Response

Sample URL: http://localhost:8080/nativeads//nativeassettype/properties

Response

{
  "metaData": {
    "startIndex": 1,
    "totalRecords": 12,
    "endIndex": 12
  },
  "items": [
    {
      "id": 1,
      "name": "len",
      "typeId": 1,
      "type": "title",
      "required": 1,
      "defaultValue": "100",
      "displayName": "Length"
    },
    {
      "id": 2,
      "name": "w",
      "typeId": 2,
      "type": "image",
      "required": 0,
      "defaultValue": "640",
      "displayName": "Width"
    },
    {
      "id": 3,
      "name": "wmin",
      "typeId": 2,
      "type": "image",
      "required": 0,
      "defaultValue": "0",
      "displayName": "Min Width"
    },
    {
      "id": 4,
      "name": "h",
      "typeId": 2,
      "type": "image",
      "required": 0,
      "defaultValue": "480",
      "displayName": "Height"
    },
    {
      "id": 5,
      "name": "hmin",
      "typeId": 2,
      "type": "image",
      "required": 0,
      "defaultValue": "0",
      "displayName": "Min Height"
    },
    {
      "id": 6,
      "name": "mime",
      "typeId": 2,
      "type": "image",
      "required": 0,
      "defaultValue": "image/png",
      "displayName": "MIME Type"
    },
    {
      "id": 7,
      "name": "len",
      "typeId": 3,
      "type": "data",
      "required": 0,
      "defaultValue": "200",
      "displayName": "Length"
    },
    {
      "id": 8,
      "name": "mime",
      "typeId": 4,
      "type": "video",
      "required": 1,
      "defaultValue": "video/xwf",
      "displayName": "MIME Type"
    },
    {
      "id": 9,
      "name": "minduration",
      "typeId": 4,
      "type": "video",
      "required": 1,
      "defaultValue": "15",
      "displayName": "Min Duration"
    },
    {
      "id": 10,
      "name": "maduration",
      "typeId": 4,
      "type": "video",
      "required": 1,
      "defaultValue": "15",
      "displayName": "Max Duration"
    },
    {
      "id": 11,
      "name": "protocols",
      "typeId": 4,
      "type": "video",
      "required": 1,
      "defaultValue": "VAST 3.0",
      "displayName": "Protocols"
    },
    {
      "id": 12,
      "name": "vpaidsupport",
      "typeId": 4,
      "type": "video",
      "required": 0,
      "defaultValue": "2",
      "displayName": "VPAID Support"
    }
  ]
}

Get List of  Native AdTag Configuration

This API lists all available Native configurations. Native configuration involves configuration of native assets along with their properties. This configuration is saved in the system and is used at the time of adserving.

Request

URI ${URI_PREFIX}/nativeads/nativeconfig
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Request Query Parameters

Parameter Name Type Required Validations Description
pubId Integer Yes   Publisher ID for which Native Configuration list should be listed

Response Body

Response Body Parameter Type Required Description
Id Integer No Native configurations Id
name String No Name for the configuration
layoutId Integer No Layout Id (Template Id) for the configuration
pubId Integer Yes Publisher Id for which the configuration is created
isDeleted Integer Yes Deleted value with be 0/1
assets Array Yes Assets array for teh configuration
assets[n].id Integer No Id of an asset
assets[n].assetId Integer No assetId that is used in openRTB JSON
assets[n].typeId Integer Yes Type Id of an asset
assets[n].typeName String Yes Type name of an asset
assets[n].subTypeId Integer No Subtype of an asset if present
assets[n].isRequired Integer Yes Required field value will be 0/1
assets[n].isDeleted Integer Yes Deleted value will be 0/1
assets[n].properties Array Yes Array of properties for an asset
assets[n].properties[n].id Integer No Id of a property not needed in case of create
assets[n].properties[n].name String Yes Name of the key. Example: w, h, len
assets[n].value String Yes Value for the key. Example: 200,30
assets[n].properties[n].isDeleted Integer Yes Value for del

Sample Request/ Response

http://localhost:8080/nativeads/nativeconfig?pubId=100307

Response

{
  "metaData": {
    "startIndex": 1,
    "totalRecords": 3,
    "endIndex": 3
  },
  "items": [
    {
      "id": 19,
      "name": "NativeConfig_100307_61522",
      "layoutId": 1,
      "pubId": 100307,
      "adunitId": 0,
      "isDeleted": 0,
      "assets": [
        {
          "id": 80,
          "assetId": 0,
          "typeId": 1,
          "typeName": "title",
          "subTypeId": 0,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 57,
              "configId": 80,
              "name": "len",
              "value": "100",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 81,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 1,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 58,
              "configId": 81,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 59,
              "configId": 81,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 60,
              "configId": 81,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 82,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 3,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 61,
              "configId": 82,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 62,
              "configId": 82,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 63,
              "configId": 82,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 83,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 2,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 64,
              "configId": 83,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 65,
              "configId": 83,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 66,
              "configId": 83,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 84,
          "assetId": 0,
          "typeId": 3,
          "typeName": "data",
          "subTypeId": 1,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 67,
              "configId": 84,
              "name": "len",
              "value": "200",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 85,
          "assetId": 0,
          "typeId": 4,
          "typeName": "video",
          "subTypeId": 0,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 68,
              "configId": 85,
              "name": "mime",
              "value": "video/xwf",
              "isDeleted": 0
            },
            {
              "id": 69,
              "configId": 85,
              "name": "minduration",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 70,
              "configId": 85,
              "name": "maduration",
              "value": "30",
              "isDeleted": 0
            },
            {
              "id": 71,
              "configId": 85,
              "name": "protocols",
              "value": "VAST 1.0,VAST 2.0,VAST 3.0",
              "isDeleted": 0
            }
          ]
        }
      ]
    },
    {
      "id": 28,
      "name": "NativeConfig_100307_99070",
      "layoutId": 1,
      "pubId": 100307,
      "adunitId": 0,
      "isDeleted": 0,
      "assets": [
        {
          "id": 117,
          "assetId": 0,
          "typeId": 1,
          "typeName": "title",
          "subTypeId": 0,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 83,
              "configId": 117,
              "name": "len",
              "value": "100",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 118,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 3,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": []
        },
        {
          "id": 119,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 2,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 84,
              "configId": 119,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 85,
              "configId": 119,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 86,
              "configId": 119,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 120,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 1,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 87,
              "configId": 120,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 88,
              "configId": 120,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 89,
              "configId": 120,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 121,
          "assetId": 0,
          "typeId": 3,
          "typeName": "data",
          "subTypeId": 1,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 90,
              "configId": 121,
              "name": "len",
              "value": "200",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 122,
          "assetId": 0,
          "typeId": 4,
          "typeName": "video",
          "subTypeId": 0,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 91,
              "configId": 122,
              "name": "mime",
              "value": "video/xwf",
              "isDeleted": 0
            },
            {
              "id": 92,
              "configId": 122,
              "name": "minduration",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 93,
              "configId": 122,
              "name": "maduration",
              "value": "30",
              "isDeleted": 0
            },
            {
              "id": 94,
              "configId": 122,
              "name": "protocols",
              "value": "VAST 1.0,VAST 2.0,VAST 3.0",
              "isDeleted": 0
            }
          ]
        }
      ]
    },
    {
      "id": 29,
      "name": "NativeConfig_100307_28931",
      "layoutId": 1,
      "pubId": 100307,
      "adunitId": 0,
      "isDeleted": 0,
      "assets": [
        {
          "id": 123,
          "assetId": 0,
          "typeId": 1,
          "typeName": "title",
          "subTypeId": 0,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 95,
              "configId": 123,
              "name": "len",
              "value": "100",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 124,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 3,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 96,
              "configId": 124,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 97,
              "configId": 124,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 98,
              "configId": 124,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 125,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 2,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 99,
              "configId": 125,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 100,
              "configId": 125,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 101,
              "configId": 125,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 126,
          "assetId": 0,
          "typeId": 2,
          "typeName": "image",
          "subTypeId": 1,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 102,
              "configId": 126,
              "name": "wmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 103,
              "configId": 126,
              "name": "hmin",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 104,
              "configId": 126,
              "name": "mime",
              "value": "image/jpeg",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 127,
          "assetId": 0,
          "typeId": 3,
          "typeName": "data",
          "subTypeId": 1,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 105,
              "configId": 127,
              "name": "len",
              "value": "200",
              "isDeleted": 0
            }
          ]
        },
        {
          "id": 128,
          "assetId": 0,
          "typeId": 4,
          "typeName": "video",
          "subTypeId": 0,
          "isRequired": 0,
          "isDeleted": 0,
          "properties": [
            {
              "id": 106,
              "configId": 128,
              "name": "mime",
              "value": "video/xwf",
              "isDeleted": 0
            },
            {
              "id": 107,
              "configId": 128,
              "name": "minduration",
              "value": "0",
              "isDeleted": 0
            },
            {
              "id": 108,
              "configId": 128,
              "name": "maduration",
              "value": "30",
              "isDeleted": 0
            },
            {
              "id": 109,
              "configId": 128,
              "name": "protocols",
              "value": "VAST 1.0,VAST 2.0,VAST 3.0",
              "isDeleted": 0
            }
          ]
        }
      ]
    }
  ]
}

Get Details of Native Configurations

 This API method retrieves the details for Native configuration saved in the system for a particular Id. 

Request

URI ${URI_PREFIX}/nativeads/configs/{id}
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Path Parameters

Parameter Name Type Required Default Possible Values Description Sample Data
Id Integer Yes     Native Configuration Id for which the details are required 2

Request Method Parameters

Parameter Name Type Required Validations Description
pubId Integer Yes   Publisher ID for which Native Configuration is being searched.

Response Body

Response Body Parameter Type Required Description
Id Integer No Native configurations Id
name String No Name for the configuration
layoutId Integer No Layout Id (Template Id) for the configuration
pubId Integer Yes Publisher Id for which the configuration is created
isDeleted Integer Yes Deleted value with be 0/1
assets Array Yes Assets array for teh configuration
assets[n].id Integer No Id of an asset
assets[n].assetId Integer No assetId that is used in openRTB JSON
assets[n].typeId Integer Yes Type Id of an asset
assets[n].typeName String Yes Type name of an asset
assets[n].subTypeId Integer No Subtype of an asset if present
assets[n].isRequired Integer Yes Required field value will be 0/1
assets[n].isDeleted Integer Yes Deleted value will be 0/1
assets[n].properties Array Yes Array of properties for an asset
assets[n].properties[n].id Integer No Id of a property not needed in case of create
assets[n].properties[n].name String Yes Name of the key. Example: w, h, len
assets[n].value String Yes Value for the key. Example: 200,30
assets[n].properties[n].isDeleted Integer Yes Value for deleted will be 0/1

Sample Request/ Response

http://localhost:8080/nativeads/nativeconfig/19?pubId=100307

Response

{
    "id": 19,
    "name": "NativeConfig_100307_61522",
    "layoutId": 1,
    "pubId": 100307,
    "adunitId": 0,
    "isDeleted": 0,
    "assets": [{
            "id": 80,
            "assetId": 0,
            "typeId": 1,
            "typeName": "title",
            "subTypeId": 0,
            "isRequired": 0,
            "isDeleted": 0,
            "properties": [{
                "id": 57,
                "configId": 80,
                "name": "len",
                "value": "100",
                "isDeleted": 0
            }]
        },
        {
            "id": 81,
            "assetId": 0,
            "typeId": 2,
            "typeName": "image",
            "subTypeId": 1,
            "isRequired": 0,
            "isDeleted": 0,
            "properties": [{
                    "id": 58,
                    "configId": 81,
                    "name": "wmin",
                    "value": "0",
                    "isDeleted": 0
                },
                {
                    "id": 59,
                    "configId": 81,
                    "name": "hmin",
                    "value": "0",
                    "isDeleted": 0
                },
                {
                    "id": 60,
                    "configId": 81,
                    "name": "mime",
                    "value": "image/jpeg",
                    "isDeleted": 0
                }
            ]
        },
        {
            "id": 82,
            "assetId": 0,
            "typeId": 2,
            "typeName": "image",
            "subTypeId": 3,
            "isRequired": 0,
            "isDeleted": 0,
            "properties": [{
                    "id": 61,
                    "configId": 82,
                    "name": "wmin",
                    "value": "0",
                    "isDeleted": 0
                },
                {
                    "id": 62,
                    "configId": 82,
                    "name": "hmin",
                    "value": "0",
                    "isDeleted": 0
                },
                {
                    "id": 63,
                    "configId": 82,
                    "name": "mime",
                    "value": "image/jpeg",
                    "isDeleted": 0
                }
            ]
        },
        {
            "id": 83,
            "assetId": 0,
            "typeId": 2,
            "typeName": "image",
            "subTypeId": 2,
            "isRequired": 0,
            "isDeleted": 0,
            "properties": [{
                    "id": 64,
                    "configId": 83,
                    "name": "wmin",
                    "value": "0",
                    "isDeleted": 0
                },
                {
                    "id": 65,
                    "configId": 83,
                    "name": "hmin",
                    "value": "0",
                    "isDeleted": 0
                },
                {
                    "id": 66,
                    "configId": 83,
                    "name": "mime",
                    "value": "image/jpeg",
                    "isDeleted": 0
                }
            ]
        },
        {
            "id": 84,
            "assetId": 0,
            "typeId": 3,
            "typeName": "data",
            "subTypeId": 1,
            "isRequired": 0,
            "isDeleted": 0,
            "properties": [{
                "id": 67,
                "configId": 84,
                "name": "len",
                "value": "200",
                "isDeleted": 0
            }]
        },
        {
            "id": 85,
            "assetId": 0,
            "typeId": 4,
            "typeName": "video",
            "subTypeId": 0,
            "isRequired": 0,
            "isDeleted": 0,
            "properties": [{
                    "id": 68,
                    "configId": 85,
                    "name": "mime",
                    "value": "video/xwf",
                    "isDeleted": 0
                },
                {
                    "id": 69,
                    "configId": 85,
                    "name": "minduration",
                    "value": "0",
                    "isDeleted": 0
                },
                {
                    "id": 70,
                    "configId": 85,
                    "name": "maduration",
                    "value": "30",
                    "isDeleted": 0
                },
                {
                    "id": 71,
                    "configId": 85,
                    "name": "protocols",
                    "value": "VAST 1.0,VAST 2.0,VAST 3.0",
                    "isDeleted": 0
                }
            ]
        }
    ]
}

 

Create Native Configuration

 This API creates the Native configuration for the AdTag. Native configuration will define the required native assets and the parameters associated with those assets.

Request

URI ${URI_PREFIX}/nativeads/nativeconfig/
HTTP Method POST

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Request Query Parameters

Parameter Name Type Required Validations Description
pubId Integer Yes   Publisher ID for which Native Configuration needs to be created.

Response Body

Response Body Parameter Type Required Description
Id Integer No Native configurations Id
name String No Name for the configuration
layoutId Integer No Layout Id (Template Id) for the configuration
pubId Integer Yes Publisher Id for which the configuration is created
isDeleted Integer Yes Deleted value with be 0/1
assets Array Yes Assets array for teh configuration
assets[n].id Integer No Id of an asset
assets[n].assetId Integer No assetId that is used in openRTB JSON
assets[n].typeId Integer Yes Type Id of an asset
assets[n].typeName String Yes Type name of an asset
assets[n].subTypeId Integer No Subtype of an asset if present
assets[n].isRequired Integer Yes Required field value will be 0/1
assets[n].isDeleted Integer Yes Deleted value will be 0/1
assets[n].properties Array Yes Array of properties for an asset
assets[n].properties[n].id Integer No Id of a property not needed in case of create
assets[n].properties[n].name String Yes Name of the key. Example: w, h, len
assets[n].value String Yes Value for the key. Example: 200,30
assets[n].properties[n].isDeleted Integer Yes Value for deleted will be 0/1

Sample Request

http://localhost:8080/nativeads/nativeconfig

Sample Request JSON

{
    "layoutId": 3,
    "pubId": 131091,
    "isDeleted": 0,
    "assets": [{
        "typeId": 1,
        "typeName": "title",
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "len",
            "value": "100",
            "isDeleted": 0
        }]
    }, {
        "typeId": 2,
        "typeName": "image",
        "subTypeId": 1,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "hmin",
            "value": "0",
            "isDeleted": 0
        }, {
            "name": "wmin",
            "value": "0",
            "isDeleted": 0
        }, {
            "name": "mime",
            "value": "image/png",
            "isDeleted": 0
        }, {
            "name": "h",
            "value": 150,
            "isDeleted": 0
        }, {
            "name": "w",
            "value": 150,
            "isDeleted": 0
        }]
    }, {
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 12,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "len",
            "value": "200",
            "isDeleted": 0
        }]
    }, {
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 3,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "len",
            "value": "200",
            "isDeleted": 0
        }]
    }]
}

 

Sample Response JSON


{
    "id": 358,
    "name": "NativeConfig_131091_95469",
    "layoutId": 3,
    "pubId": 131091,
    "adunitId": 0,
    "isDeleted": 0,
    "assets": [{
        "id": 1150,
        "assetId": 0,
        "typeId": 1,
        "typeName": "title",
        "subTypeId": 0,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2467,
            "configId": 1150,
            "name": "len",
            "value": "100",
            "isDeleted": 0
        }]
    }, {
        "id": 1151,
        "assetId": 0,
        "typeId": 2,
        "typeName": "image",
        "subTypeId": 1,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2468,
            "configId": 1151,
            "name": "hmin",
            "value": "0",
            "isDeleted": 0
        }, {
            "id": 2469,
            "configId": 1151,
            "name": "wmin",
            "value": "0",
            "isDeleted": 0
        }, {
            "id": 2470,
            "configId": 1151,
            "name": "mime",
            "value": "image/png",
            "isDeleted": 0
        }, {
            "id": 2471,
            "configId": 1151,
            "name": "h",
            "value": "150",
            "isDeleted": 0
        }, {
            "id": 2472,
            "configId": 1151,
            "name": "w",
            "value": "150",
            "isDeleted": 0
        }]
    }, {
        "id": 1152,
        "assetId": 0,
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 12,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2473,
            "configId": 1152,
            "name": "len",
            "value": "200",
            "isDeleted": 0
        }]
    }, {
        "id": 1153,
        "assetId": 0,
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 3,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2474,
            "configId": 1153,
            "name": "len",
            "value": "200",
            "isDeleted": 0
        }]
    }],
    "requestJSON": "{\"layout\":3,\"assets\":[{\"id\":1,
    \"required\":1,\"title\":{\"len\":100}},{\"id\":2,\"required\":1,\"img\":{\"type\":1,\"w\":150,\"h\": 150,
    \"mimes\":[\"image/png\"]}},{\"id\":3,\"required\":1,\"data\":{\"type\":12,\"len\":200}},{\"id\": 4,
    \"required\":1,\"data\":{\"type\":3,\"len\":200}}]}"
}

Edit Native Configurations 

This API is used to edit an existing Native configuration.

Request

URI ${URI_PREFIX}/nativeads/nativeconfig/
HTTP Method PUT

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Request Query Parameters

Parameter Name Type Required Validations Description
pubId Integer Yes   Publisher ID for which Native Configuration needs to be updated.

 

Sample Request

http://localhost:8080/nativeads/nativeconfig/19?pubId=131091

Sample Request JSON

{
    "layoutId": 3,
    "pubId": 131091,
    "isDeleted": 0,
    "id": 358,
    "name": "NativeConfig_131091_95469",
    "assets": [{
        "typeId": 1,
        "typeName": "title",
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "len",
            "value": "100",
            "isDeleted": 0,
            "id": 2467
        }],
        "id": 1150
    }, {
        "typeId": 2,
        "typeName": "image",
        "subTypeId": 1,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "hmin",
            "id": 2468,
            "value": "0",
            "isDeleted": 0,
            "configId": 1150
        }, {
            "name": "wmin",
            "id": 2469,
            "value": "0",
            "isDeleted": 0,
            "configId": 1151
        }, {
            "name": "mime",
            "value": "image/png",
            "isDeleted": 0,
            "id": 2470,
            "configId": 1151
        }, {
            "name": "h",
            "value": 150,
            "isDeleted": 0,
            "id": 2471,
            "configId": 1151
        }, {
            "name": "w",
            "value": 150,
            "isDeleted": 0,
            "id": 2472,
            "configId": 1151
        }],
        "id": 1151
    }, {
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 12,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "len",
            "value": "201",
            "isDeleted": 0,
            "id": 2473
        }],
        "id": 1152
    }, {
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 3,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "name": "len",
            "value": "200",
            "isDeleted": 0,
            "id": 2474
        }],
        "id": 1153
    }]
}

Request Body

Response Body Parameter Type Required Description
Id Integer No Native configurations Id
name String No Name for the configuration
layoutId Integer No Layout Id (Template Id) for the configuration
pubId Integer Yes Publisher Id for which the configuration is created
isDeleted Integer Yes Deleted value with be 0/1
assets Array Yes Assets array for teh configuration
assets[n].id Integer No Id of an asset
assets[n].assetId Integer No assetId that is used in openRTB JSON
assets[n].typeId Integer Yes Type Id of an asset
assets[n].typeName String Yes Type name of an asset
assets[n].subTypeId Integer No Subtype of an asset if present
assets[n].isRequired Integer Yes Required field value will be 0/1
assets[n].isDeleted Integer Yes Deleted value will be 0/1
assets[n].properties Array Yes Array of properties for an asset
assets[n].properties[n].id Integer No Id of a property not needed in case of create
assets[n].properties[n].name String Yes Name of the key. Example: w, h, len
assets[n].value String Yes Value for the key. Example: 200,30
assets[n].properties[n].isDeleted Integer Yes Value for deleted will be 0/1

Sample Response JSON


{
    "id": 358,
    "name": "NativeConfig_131091_95469",
    "layoutId": 3,
    "pubId": 131091,
    "adunitId": 0,
    "isDeleted": 0,
    "assets": [{
        "id": 1150,
        "assetId": 0,
        "typeId": 1,
        "typeName": "title",
        "subTypeId": 0,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2467,
            "configId": 0,
            "name": "len",
            "value": "100",
            "isDeleted": 0
        }]
    }, {
        "id": 1151,
        "assetId": 0,
        "typeId": 2,
        "typeName": "image",
        "subTypeId": 1,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2468,
            "configId": 1150,
            "name": "hmin",
            "value": "0",
            "isDeleted": 0
        }, {
            "id": 2469,
            "configId": 1151,
            "name": "wmin",
            "value": "0",
            "isDeleted": 0
        }, {
            "id": 2470,
            "configId": 1151,
            "name": "mime",
            "value": "image/png",
            "isDeleted": 0
        }, {
            "id": 2471,
            "configId": 1151,
            "name": "h",
            "value": "150",
            "isDeleted": 0
        }, {
            "id": 2472,
            "configId": 1151,
            "name": "w",
            "value": "150",
            "isDeleted": 0
        }]
    }, {
        "id": 1152,
        "assetId": 0,
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 12,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2473,
            "configId": 0,
            "name": "len",
            "value": "201",
            "isDeleted": 0
        }]
    }, {
        "id": 1153,
        "assetId": 0,
        "typeId": 3,
        "typeName": "data",
        "subTypeId": 3,
        "isRequired": 1,
        "isDeleted": 0,
        "properties": [{
            "id": 2474,
            "configId": 0,
            "name": "len",
            "value": "200",
            "isDeleted": 0
        }]
    }],
    "requestJSON": "{\"layout\":3,\"assets\":[{\"id\":1,\"required\
    ":1,\"title\":{\"len\":100}},{\"id\":2,\"required\":1,\"img\":{\"type\":1,\"w\":150,\"h\":150,\"mimes\
    ":[\"image/png\"]}},{\"id\":3,\"required\":1,\"data\":{\"type\":12,\"len\":201}},{\"id\":4,\"required\
    ":1,\"data\":{\"type\":3,\"len\":200}}]}"
}

Update ​NativeHTML Template

This API is exposed to update HTML template for a given Native configuration in the system. HTML template is the HTML code for a given adslot of publisher page where Native Ad needs to be rendered. This template holds macros for different assets that need to be populated during Ad serving.

Request

URI ${URI_PREFIX}/nativeads/nativeconfig/${NATIVE_CONFIG_ID}/htmlTemplate?pubId={PUB_ID}
HTTP Method PUT

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Request Query Parameters

Parameter Name Type Required Validations Description
pubId Integer Yes   Publisher ID

Path Parameters

Id for the native configuration should be passed as a path parameter. Refer to Sample Request JSON below.

Sample Request JSON

http://localhost:8080/nativeads/nativeconfig/33/htmlTemplate?pubId=31400

Sample Request Body

{
"template": " HTML TEMPLATE CODE WITH PUBMATIC ASSET MACROS AS PER REQUEST JSON CONFIGURED "
}

 

Native Image Size

This API returns the list of valid image sizes for image asset configured for a Native AdTag.

Request

URI ${URI_PREFIX}/nativeads/nativeimagesize
HTTP Method GET

Request Headers

Header Name Type Required Validations Description
PubToken String Yes  

Used for Authorization.

Need to send the access token generating for authentication at the place of ${access_token}.

For more information about access token, refer the Before You Start section.

Sample Request/Response JSON

Sample URL Request : http://localhost:8080/nativeads/nativeimagesize

Response 

{
"metaData": {
"startIndex": 1,
"totalRecords": 10,
"endIndex": 10
},
"items": [{
"aspectRatio": "1:1",
"sizes": [{
"id": 1,
"isDefault": 1,
"subtype": "icon",
"width": 75,
"height": 75
},
{
"id": 2,
"isDefault": 0,
"subtype": "icon",
"width": 150,
"height": 150
},
{
"id": 3,
"isDefault": 0,
"subtype": "icon",
"width": 300,
"height": 300
},
{
"id": 22,
"isDefault": 1,
"subtype": "logo",
"width": 75,
"height": 75
},
{
"id": 23,
"isDefault": 0,
"subtype": "logo",
"width": 150,
"height": 150
},
{
"id": 24,
"isDefault": 0,
"subtype": "logo",
"width": 300,
"height": 300
}
]
},
{
"aspectRatio": "3:2",
"sizes": [{
"id": 4,
"isDefault": 1,
"subtype": "main",
"width": 480,
"height": 320
},
{
"id": 5,
"isDefault": 0,
"subtype": "main",
"width": 960,
"height": 640
},
{
"id": 6,
"isDefault": 0,
"subtype": "main",
"width": 1200,
"height": 800
}
]
},
{
"aspectRatio": "6:5",
"sizes": [{
"id": 7,
"isDefault": 0,
"subtype": "main",
"width": 300,
"height": 250
}]
},
{
"aspectRatio": "9:16",
"sizes": [{
"id": 8,
"isDefault": 0,
"subtype": "main",
"width": 320,
"height": 568
},
{
"id": 9,
"isDefault": 0,
"subtype": "main",
"width": 640,
"height": 1136
},
{
"id": 10,
"isDefault": 0,
"subtype": "main",
"width": 720,
"height": 1280
}
]
},
{
"aspectRatio": "5:6",
"sizes": [{
"id": 11,
"isDefault": 0,
"subtype": "main",
"width": 250,
"height": 300
}]
},
{
"aspectRatio": "16:9",
"sizes": [{
"id": 12,
"isDefault": 0,
"subtype": "main",
"width": 568,
"height": 320
},
{
"id": 13,
"isDefault": 0,
"subtype": "main",
"width": 1136,
"height": 640
},
{
"id": 14,
"isDefault": 0,
"subtype": "main",
"width": 1280,
"height": 720
}
]
},
{
"aspectRatio": "728:90",
"sizes": [{
"id": 15,
"isDefault": 0,
"subtype": "main",
"width": 728,
"height": 90
}]
},
{
"aspectRatio": "256:135",
"sizes": [{
"id": 16,
"isDefault": 0,
"subtype": "main",
"width": 600,
"height": 313
},
{
"id": 17,
"isDefault": 0,
"subtype": "main",
"width": 1200,
"height": 627
}
]
},
{
"aspectRatio": "320:50",
"sizes": [{
"id": 18,
"isDefault": 0,
"subtype": "main",
"width": 320,
"height": 50
}]
},
{
"aspectRatio": "2:3",
"sizes": [{
"id": 19,
"isDefault": 0,
"subtype": "main",
"width": 320,
"height": 480
},
{
"id": 20,
"isDefault": 0,
"subtype": "main",
"width": 640,
"height": 960
},
{
"id": 21,
"isDefault": 0,
"subtype": "main",
"width": 800,
"height": 1200
}
]
}
]
}

Response Body

Response Body Parameter Type Description
aspectRatio String Ratio of width to height of the image sizes
sizes Array Array of sizes for a given aspect ratio
sizes[n].id Integer Id of the image size
sizes[n].isDefault Boolean This can be ignored
sizes[n].subtype String Asset Subtype for which this size is applicable e.g., Main, Icon or Logo
sizes[n].width Integer Width of the image
sizes[n].height Integer Height of the image