Page tree



Unified Ad Server Ad Unit Format API retrieves the Ad Unit Format details. In the query, you can also apply supported dimensions, filters and sorting options to retrieve a list of Ad Units with a specific set of details according to your requirements.

For more information about UAS Inventory Management Services APIs, see Inventory Management Services (UAS).

Supported Operations

Service Name: /adunitformats/

Method PathHTTP Method TypeDescriptionLink to Definition
/adunitformats/GET

Retrieve details for all supported ad unit formats. 

Apply supported dimensions, filters and sorting options to retrieve a list of Ad Unit Formats with a specific set of details as required.

Retrieve list of Ad Unit Formats
/adunitformats/{id}GETRetrieve the details of a specific Ad Unit format for a specific Ad Unit Format.Retrieve Details of Ad Unit Format


Request Headers

Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.
AuthorizationStringBearer ${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, see Getting Started with PubMatic APIs.


Operations and Samples

The following sections describe the Ad Unit Format API operations and provide sample code to demonstrate usage. Unless otherwise noted in the operation definition, each operation uses the request headers listed above.

Retrieve list of Ad Unit Formats

This operation retrieves the list of Ad Units associated with your account. In the query, you can also apply supported dimensions, filters, and sorting options to retrieve a list of Ad Units with a specific set of details according to your requirements. 


See Common Request Query Parameters to learn more about using dimensions, sort, and filter options.

Request

See  Request Headers  above for request header requirements.

Request Sample URL

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

Response

Sample Response JSON

{
    "metaData": {
        "startIndex": 1,
        "totalRecords": 3,
        "pageNumber": 1,
        "endIndex": 3,
        "pageSize": 100
    },
    "items": [{
        "id": 3,
        "name": "Banner/Rich Media",
        "adUnitResponseFormat": {
            "id": 1,
            "url": "http://$URI_PREFIX/phoenix/adunitresponseformats/1"
        },
        "description": "Banner/Rich Media Ad Unit"
    }, {
        "id": 12,
        "name": "Native",
        "adUnitResponseFormat": {
            "id": 1,
            "url": "http://$URI_PREFIX/phoenix/adunitresponseformats/1"
        },
        "description": "Native Ads"
    }, {
        "id": 13,
        "name": "Video",
        "adUnitResponseFormat": {
            "id": 1,
            "url": "http://$URI_PREFIX/phoenix/adunitresponseformats/1"
        },
        "description": "Video Ads"
    }]
}


Retrieve Details of Ad Unit Format

This API lets you retrieve details of a specific Ad Unit format for the requested Ad Unit Format Id.

Request

See  Request Headers  above for request header requirements.

Request Sample URL

https://api.pubmatic.com/v1/uas/adunitformats/3


Response

Response Body Parameters

Parameter NameTypeRequiredValidationsDescription
idNumericNo

Must exist and be a a valid id.

PubMatic identifier for Ad Unit Format
nameStringYes

Name can be a maximum of 64 characters.

Name should be unique for your account.

Ad Unit format name 
descriptionStringNo

Description can be a maximum of 1024 characters. Default is null.

Description to store more details for ad unit format.
adUnitResponseFormatNumericYesAd Unit Response Format is valid and must exist.Every ad unit format is associated with one or more than one ad unit response format.


Sample Response JSON

{
    "id": 3,
    "name": "Banner/Rich Media",
    "adUnitResponseFormat": {
        "id": 1,
        "url": "http://api.pubmatic.com/v1/uas/adunitresponseformats/1"
    },
    "description": "Banner/Rich Media Ad Unit"
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


Error Codes for Ad Unit Format

Sr. No.Error CodeDescription
1.MISSING_OR_INVALID_PARAMETER

This error message will occur when an Ad Unit request is missing or contains an invalid parameter in the request.

This can occur for the following parameters:

  • Ad Unit Format Id
  • Ad Unit Response Format Id
  • Name

⇧ Top