Page tree


Before using PubMatic APIs, first generate the API Token. For more information, refer to  Getting Started with PubMatic APIs .

The Rule Manager allows a publisher to create rules which will affect the bidding process of its inventory. A publisher can create a rule specific to a certain demand partner and set a price floor value. This will ensure that the publisher receives certain minimum revenue from that demand partner when the demand partner bids for the publisher's inventory. The Rules allows a publisher to create rules in the AdFlex Standard campaign or RTB campaign.


This API provides information about managing the RTB rules.


Methods    

Method Path

HTTP Method
Type

DescriptionLink to Definition
/rules/GETRetrieve all rules for the given publisher IDRetrieving List of Rules
/rules/{id}GETRetrieve the details of a specific ruleRetrieving Details of a Rule


Retrieving a List of Rules

This API provides information about retrieving the list of rules.


Request

         

URIhttp://{URI_PREFIX}/rulemgmt/rules
Uri prefix details URI_PREFIX
HTTP MethodGET

Request Headers

           

Header NameRequired
PubTokenyes

Request Query Parameters

                           

Parameter NameTypeRequiredDescription
pubIdIntegerYes 
pageNumberIntegeroptionaldefault value is 1
pageSizeIntegeroptionaldefault value is 100

Request


Response Headers

           

Response Header NameType
Content-typeapplication-json

 

Response Body

                                                                                                                      

Response Body Parameter

Type

Description

metaData

Object

Pagination details

id

Integer

Rule Identifier

name

String

Rule name

pubId

Long

Rule publisher ID

ruletype.id

Integer

Rule type identifier

ruletype.name

String

Rule type name

ruleStatus.id

Integer

Rule status identifier

ruleStatus.name

String

Rule status name

priority

Integer

Rule priority

floorValue

Integer

Rule floor value

startDate

String

Rule start date

endDate

String

Rule end date

startTimeParting

String

Rule start time

endTimeParting

String

Rule end time

daysOfWeek

Object

Days configured for rule

goalCpmEnabled

Integer

Flag for goal ecpm enabled

minimumBidValue

Decimal

Minimum bid value for rule

timezone.id

Integer

Time zone ID

timezone.name

String

Time zone name

comments

String

Comments on rule

additionalInfo

String

Additional information on rule

ruleTargetting

Object

Object containing rule entities

Sample Response JSON


{
   "metaData": {
      "request": {
         "pageSize": "20",
         "pageNumber": "1",
         "filters": [
            "pubId eq 26151"
         ]
      },
      "startIndex": 1,
      "totalRecords": 237,
      "endIndex": 1
   },
   "items": [
     {

   "id": 2,
   "name": "generalmills.com Floor",
   "pubId": 26151,
   "ruletype": {
      "id": 1,
      "name": "PMPF"
   },
   "ruleStatus": {
      "id": 1,
      "name": "Active"
   },
   "priority": 15,
   "floorValue": 999,
   "startDate": "2011-11-13T18:30:00Z",
   "startTimeParting": "00:00:00",
   "endTimeParting": "23:59:59",
   "daysOfWeek": [
      "AllDays"
   ],
   "goalCpmEnabled": false,
   "minimumBidValue": 0,
   "timezone": {
      "id": 1,
      "name": "PST"
   },
   "ruleTargetting": {
      "advertisers": [
         {
            "id": 6161,
            "uri": "http://localhost/common/advertiser/6161"
         },
         {
            "id": 9067,
            "uri": "http://localhost/common/advertiser/9067"
         }
      ],
      "sites": [
         {
            "id": 26167,
            "uri": "http://localhost/inventory/publisherSites/26167"
         }
      ]
   }
  }
   ]
}
}
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Error Codes

           

Error Code

Error Description

RC01_001

No records found


Retrieving the Details of a Rule

This topic provides information about retrieving a specific rule details.

Request

         

URIhttp://{URI_PREFIX}/rulemgmt/rules/{id}
Uri prefix details URI_PREFIX
HTTP MethodGET

Request Headers      

Header NameRequired
PubTokenyes

Response

Response Headers

           

Response Header NameType
Content-type application-json


Response Body
                                                                                               

Response Body ParameterTypeDescription
idIntegerRule Identifier
nameStringRule name
pubIdLongRule publisher ID
ruletype.idIntegerRule type identifier
ruletype.nameStringRule type name
ruleStatus.idIntegerRule status identifier
ruleStatus.nameStringRule status name
priorityIntegerRule priority
floorValueIntegerRule floor value
startDateStringRule start date
endDateStringRule end date
startTimePartingStringRule start time
endTimePartingStringRule end time
daysOfWeekObjectDays configured for rule
goalCpmEnabledIntegerFlag for goal ecpm enabled
minimumBidValueDecimalMinimum bid value for rule
timezone.idIntegerTime zone ID
timezone.nameStringTime zone name
commentsStringComments on rule
additionalInfoStringAdditional information on rule
ruleTargettingObjectObject containing rule entities


Sample Response JSON:


{
   "id": 2,
   "name": "generalmills.com Floor",
   "pubId": 26151,
   "ruletype": {
      "id": 1,
      "name": "PMPF"
   },
   "ruleStatus": {
      "id": 1,
      "name": "Active"
   },
   "priority": 15,
   "floorValue": 999,
   "startDate": "2011-11-13T18:30:00Z",
   "startTimeParting": "00:00:00",
   "endTimeParting": "23:59:59",
   "daysOfWeek": [
      "AllDays"
   ],
   "goalCpmEnabled": false,
   "minimumBidValue": 0,
   "timezone": {
      "id": 1,
      "name": "PST"
   },
   "ruleTargetting": {
      "advertisers": [
         {
            "id": 6161,
            "uri": "http://localhost/common/advertiser/6161"
         },
         {
            "id": 9067,
            "uri": "http://localhost/common/advertiser/9067"
         }
      ],
      "sites": [
         {
            "id": 26167,
            "uri": "http://localhost/inventory/publisherSites/26167"
         }
      ]
   }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Error Codes

           

Error CodeError Description
RC01_001No records found