Rule Manager API

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

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
Description
Link to Definition
/rules/
GET
Retrieve all rules for the given publisher ID
Retrieving List of Rules
/rules/{id}
GET
Retrieve the details of a specific rule
Retrieving Details of a Rule

 

Retrieving a List of Rules

This API provides information about retrieving the list of rules.

 

Request

         

URI
http://{URI_PREFIX}/rulemgmt/rules
Uri prefix details URI_PREFIX
HTTP Method
GET

Request Headers

           

Header Name
Required
PubToken
yes

Request Query Parameters

                           

Parameter Name
Type
Required
Description
pubId
Integer
Yes
 
pageNumber
Integer
optional
default value is 1
pageSize
Integer
optional
default value is 100

Request

 

Response Headers

           

Response Header Name
Type
Content-type
application-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

         

URI
http://{URI_PREFIX}/rulemgmt/rules/{id}
Uri prefix details URI_PREFIX
HTTP Method
GET

Request Headers      

Header Name
Required
PubToken
yes

Response

Response Headers

           

Response Header Name
Type
Content-type 
application-json

 

Response Body
                                                                                               

Response Body Parameter
Type
Description
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:

{
   "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

Attachments

    Outcomes