Welcome‎ > ‎Version 2‎ > ‎Publisher Api (Read/Write)‎ > ‎Methods‎ > ‎1 - Offer‎ > ‎

General Offers Query

Will get all offers for the publisher based on a set of filtering parameters.

Method: /api/v2/publisher/offers?format={format}&pagenumber={pageNumber}&pagesize={pageSize}&startDate={startDate}&endDate={endDate}&SegmentKeys={SegmentKeys}&ClassificationIds={ClassificationIds}&Tags={Tags}&Timeframe={Timeframe}&OrderBy={OrderBy}

RequiredParameters:
  
none

OptionalParameters:
  format - The format of the results. json or xml. Default = "json"
  pageNumber- The page number for results. Default = 1
  pageSize - The number of records to return per page.  Default = 10
  startDate - The date filter to apply against the offer start time.
  endDate - The
 date filter to apply against the offer end time.  
  SegmentKeys - The segment keys filter to apply against the offer segment key, specified as a comma separated list.  e.g. "ny,sea,mia"
  ClassificationKeys - The classification keys filter to apply against the offer classification keys, specified as a comma separated list.  e.g. "auto,autorepair,carwash"
  Tags - The tags filter to apply against the offer tags, specified as a comma separates list.  e.g. "sports,basketball,training"
  Timeframe - The timeframe filter to apply against the offer timeframe.  Current, Past, or Future.
  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 "starttime asc,publisherdealid desc" orders by starttime ascending, and then by publisherdealid descending.  Currently supported values: starttime, endtime, and/or publisherdealid with asc or desc.
  
Returns:
  Paged list of OfferDetail

Sample Request:
GET /api/v2/publisher/offers?pagenumber=1&pagesize=10&startDate=20110410-20110425&SegmentKeys=ny,sea&ClassificationKeys=no_sub_classification&Tags=tag,tag2,tag3&Timeframe=PAST&OrderBy=starttime asc,offerid desc&apiKey=43c5c674-620c-4f2b-bdcf-3082c99e8186 HTTP/1.1
Host: apitest.groupcommerce.com

Sample XML Response:
<offerDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <errors/>
  <lastPublished>
    2011-08-30T22:14:46.5933686Z
  </lastPublished>
  <success>
    true
  </success>
  <version>
    2
  </version>
  <metaData>
    <pageCount>
      1
    </pageCount>
    <pageNumber>
      1
    </pageNumber>
    <pageSize>
      10
    </pageSize>
    <totalItems>
      3
    </totalItems>
  </metaData>
  <data>
    <offerDetail>
      <copy>
        Description
      </copy>
      <customFields>
        <field>
          <key>
            AdditionalCopy
          </key>
          
<value>AdditionalCopyValueTextTest</value>
        </field>
        <field>
          <key>
            AdditionalCopy2
          </key>
          <value i:nil="true"/>
        </field>
        <field>
          <key>
            AdditionalCopy3
          </key>
          <value i:nil="true"/>
        </field>
        <field>
          <key>
            EmailSubjectLine
          </key>
          <value i:nil="true"/>
        </field>
        <field>
          <key>
            Custom Countdown Copy
          </key>
          <value i:nil="true"/>
        </field>
      </customFields>
      <endDate>
        2011-06-05T05:00:00Z
      </endDate>
      <fineprint i:nil="true"/>
      <hasEnded>
        true
      </hasEnded>
      <hasSoldOut>
        false
      </hasSoldOut>
      <headline>
        PublisherDealOption Title DealID 0 PublisherID 6
      </headline>
      <highlights>
        Highlights
      </highlights>
      <images>
        <image>
          <caption>
            Deal Asset
          </caption>
          <displayOrder>
            0
          </displayOrder>
          <isOfferImage>
            true
          </isOfferImage>
          <size>
            640x360
          </size>
          <tags/>
          <thumbnailUrl/>
          <url>
            http://gcs-dev.s3.amazonaws.com/shared/images/deals/1342/1398/integrationtests.com%2fkoala.png
          </url>
        </image>
      </images>
      <locations>
        <address>
          <city>
            New York
          </city>
          <country>
            US
          </country>
          <latitude>
            0
          </latitude>
          <longitude>
            0
          </longitude>
          <name i:nil="true"/>
          <phone i:nil="true"/>
          <postalCode>
            10003
          </postalCode>
          <state>
            NY
          </state>
          <street1>
            321 Sesame St.
          </street1>
          <street2 i:nil="true"/>
          <website>
            http://testvendor.com
          </website>
        </address>
      </locations>
      <maxQuantityPerBuyer>
        100
      </maxQuantityPerBuyer>
      <merchant>
        <address>
          <city>
            New York
          </city>
          <country>
            US
          </country>
          <latitude>
            0
          </latitude>
          <longitude>
            0
          </longitude>
          <name i:nil="true"/>
          <phone i:nil="true"/>
          <postalCode>
            10003
          </postalCode>
          <state>
            NY
          </state>
          <street1>
            321 Sesame St.
          </street1>
          <street2 i:nil="true"/>
          <website i:nil="true"/>
        </address>
        <companyName>
          Integration Test Vendor
        </companyName>
        <id>
          893
        </id>
        <phone i:nil="true"/>
        <website>
          http://testvendor.com
        </website>
      </merchant>
      <offerId>
        1398
      </offerId>
      <rank>
        0
      </rank>
      <redemptionInstructions i:nil="true"/>
      <segments>
        <segment>
          <key>
            all-cities
          </key>
          <name>
            All Cities
          </name>
        </segment>
        <segment>
          <key>
            ny
          </key>
          <name>
            New York
          </name>
        </segment>
      </segments>
      <startDate>
        2011-04-12T20:43:20Z
      </startDate>
      <subtitle i:nil="true"/>
      <url>
        http://rewards.staging.thrillist.com/deal/1398/deal-option-title
      </url>
      <classification>
        <classification>
          <key>
            no_sub_classification
          </key>
          <parentKey>
            no_classification
          </parentKey>
        </classification>
      </classification>
      <demandStrategy>
        NotSpecified
      </demandStrategy>
      <numberSold>
        0
      </numberSold>
      <options>
        <option>
          <blurb>
            Description
          </blurb>
          <demandStrategy>
            NotSpecified
          </demandStrategy>
          <hasSoldOut>
            false
          </hasSoldOut>
          <inventoryRemaining>
            1000
          </inventoryRemaining>
          <maxQuantity>
            1000
          </maxQuantity>
          <numberSold>
            0
          </numberSold>
          <offerOptionId>
            676
          </offerOptionId>
          <pricing>
            <currency>
              USD
            </currency>
            <discountPercent>
              50.00
            </discountPercent>
            <originalPrice>
              100
            </originalPrice>
            <price>
              50
            </price>
            <promotionalPrice i:nil="true"/>
            <savings>
              50
            </savings>
          </pricing>
          <pricingStrategy>
            NotSpecified
          </pricingStrategy>
          <title>
            PublisherDealOption Title DealID 0 PublisherID 6
          </title>
        </option>
      </options>
      <pricingStrategy>
        NotSpecified
      </pricingStrategy>
      <tags>
        <tag>
          tag
        </tag>
        <tag>
          tag3
        </tag>
      </tags>
      <maxGiftQuantityPerBuyer>
        100
      </maxGiftQuantityPerBuyer>
      <offerKey>
        deal-option-title
      </offerKey>
      <video i:nil="true"/>
    </offerDetail>
  </data>
</offerDetails>

Sample JSON Response:

{
 "errors":[],
   "lastPublished":"\/Date(1314742043585)\/",
   "success":true,
   "version":"2",
   "metaData":{
      "pageCount":1,
      "pageNumber":1,
      "pageSize":10,
      "totalItems":3
   },
   "data":[
      {
         "copy":"Description",
         "customFields":[
            {
               "Key":"AdditionalCopy",
               "Value":AdditonalCopyValueTextTest
            },
            {
               "Key":"AdditionalCopy2",
               "Value":null
            },
            {
               "Key":"AdditionalCopy3",
               "Value":null
            },
            {
               "Key":"EmailSubjectLine",
               "Value":null
            },
            {
               "Key":"Custom Countdown Copy",
               "Value":null
            }
         ],
         "endDate":"\/Date(1307250000000)\/",
         "fineprint":null,
         "hasEnded":true,
         "hasSoldOut":false,
         "headline":"PublisherDealOption Title DealID 0 PublisherID 6",
         "highlights":"Highlights",
         "images":[
            {
               "caption":"Deal Asset",
               "displayOrder":"0",
               "isOfferImage":true,
               "size":"640x360",
               "tags":[

               ],
               "thumbnailUrl":"",
               "url":"http:\/\/gcs-dev.s3.amazonaws.com\/shared\/images\/deals\/1342\/1398\/integrationtests.com%2fkoala.png"
            }
         ],
         "locations":[
            {
               "city":"New York",
               "country":"US",
               "latitude":0,
               "longitude":0,
               "name":null,
               "phone":null,
               "postalCode":"10003",
               "state":"NY",
               "street1":"321 Sesame St.",
               "street2":null,
               "website":"http:\/\/testvendor.com"
            }
         ],
         "maxQuantityPerBuyer":100,
         "merchant":{
            "address":{
               "city":"New York",
               "country":"US",
               "latitude":0,
               "longitude":0,
               "name":null,
               "phone":null,
               "postalCode":"10003",
               "state":"NY",
               "street1":"321 Sesame St.",
               "street2":null,
               "website":null
            },
            "companyName":"Integration Test Vendor",
            "id":893,
            "phone":null,
            "website":"http:\/\/testvendor.com"
         },
         "offerId":1398,
         "rank":0,
         "redemptionInstructions":null,
         "segments":[
            {
               "key":"all-cities",
               "name":"All Cities"
            },
            {
               "key":"ny",
               "name":"New York"
            }
         ],
         "startDate":"\/Date(1302641000000)\/",
         "subtitle":null,
         "url":"http:\/\/rewards.staging.thrillist.com\/deal\/1398\/deal-option-title",
         "classification":[
            {
               "key":"no_sub_classification",
               "parentKey":"no_classification"
            }
         ],
         "demandStrategy":"NotSpecified",
         "numberSold":0,
         "options":[
            {
               "blurb":"Description",
               "demandStrategy":"NotSpecified",
               "hasSoldOut":false,
               "inventoryRemaining":1000,
               "maxQuantity":1000,
               "numberSold":0,
               "offerOptionId":676,
               "pricing":{
                  "currency":"USD",
                  "discountPercent":50.00,
                  "originalPrice":100,
                  "price":50,
                  "promotionalPrice":null,
                  "savings":50
               },
               "pricingStrategy":"NotSpecified",
               "title":"PublisherDealOption Title DealID 0 PublisherID 6"
            }
         ],
         "pricingStrategy":"NotSpecified",
         "tags":[
            "tag",
            "tag3"
         ],
         "maxGiftQuantityPerBuyer":100,
         "offerKey":"deal-option-title",
         "video":null
      }
   ]
}

Comments