Will get all offers for the publisher based on a set of filtering parameters. Offers with no visible (active) options are not returned.
Method: GET /api/v3/publisher/offers?pagenumber={pageNumber}&pagesize={pageSize}&Timeframe={timeframe}&startDate={startDate}&endDate={endDate}&OrderBy={orderBy}&segmentKeys={segmentKeys}&ClassificationKeys={classificationKeys}&Tags={tags}
Authentication: oauth
Parameters
Required |
QueryString Value
|
Explanation |
No |
ClassificationKeys |
The classification keys filter to apply against the offer classification keys, specified as a comma separated list. e.g. "auto,autorepair,carwash"
|
No |
EndDate |
The date range to filter against the end date of the offer.
|
No |
OrderBy |
The columns the records should be sorted on and the direction of the sort, specified as a comma separated list. e.g. the value "startdate asc, offerid desc" orders by startdate ascending, and then by offerid descending. Currently supported values: startdate, enddate, and/or offerid with asc or desc. Default is startdate asc.
|
No
|
PageNumber |
The page number of records to return. Default is 1
|
No
|
PageSize
|
The number of records to return per page. Default is 10
|
No |
SegmentKeys |
The segment keys filter to apply against the offer segment key, specified as a comma separated list. e.g. "ny,sea,mia"
|
No
|
StartDate
|
The date range to filter against the start date of the offer.
|
No |
State
|
The state the offer is in. One of { All, Archived, Copy, FinalReview, ReadyToSchedule, Scheduled }. Default is Scheduled.
|
No |
Tags |
The tags filter to apply against the offer tags, specified as a comma separated list. e.g. "sports,basketball,training"
|
No |
Timeframe |
The timeframe to filter against the offer timeframe. { All, Current, Past, Future }. Default is Current.
|
Returns
base response fields
offers - Will return a list of Offers.
Sample Request:
GET http://api.groupcommerce.com/api/v3/publisher/offers?pagenumber=1&pagesize=20&state=Scheduled&Timeframe=Current&startDate=t0-t1322609586&endDate=t0-t2342508586&OrderBy=StartDate+asc%2cRank+desc&SegmentKeys=new-york%2cnational&ClassificationKeys=pet_training%2chealthtrainers&Tags=tag1%2ctag2%2ctag3
Authorization: OAuth oauth_signature="QCm7w6XsTzg4fTcCFA5WzeEc7zI%3d", oauth_nonce="9575949", oauth_timestamp="1322606545", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"
Sample JSON Response:
{
"errors": [],
"lastPublished": "/Date(1322607433092)/",
"success": true,
"version": "3",
"metaData": {
"pageCount": 1,
"pageNumber": 1,
"pageSize": 20,
"totalItems": 2
},
"offers": [
{ /* see offer */ },
{ /* see offer */ }
]
}
Sample XML Response:
<getOffersResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<errors/>
<lastPublished>2011-11-29T22:59:59.3406803Z</lastPublished>
<success>true</success>
<version>3</version>
<metaData>
<pageCount>1</pageCount>
<pageNumber>1</pageNumber>
<pageSize>20</pageSize>
<totalItems>2</totalItems>
</metaData>
<offers>
<offer>
<!-- see offer -->
</offer>
<offer>
<!-- see offer -->
</offer>
</offers>
</getOffersResponse>
|
|