Offer API

CityGrid Advertising APIs

Offer API

Introduction

The CityGrid Offer API is part of the Advertising by CityGrid suite of APIs which allows developers to  manage the Deals and Special Offers shown on their campaign listing profile page as well as on deal and coupon sites. 

Contents

 

Offer Get Endpoint

The offer get endpoint retrieves information about a set of selected offers. The operation is invoked via HTTPS GET to:

Request Parameters

Parameter

Description

Required

Type

Default

Example

offerIds

Comma-separated list of offer IDs.

No

Comma separated list of Long values

—

798855,1334954

externalPlaceIds

Comma-separated list of external place IDs. Used to retrieve all offers related to each place indicated.

No

Comma separated list of Strings

—

BDF_Business1,BDF_Business33

placeIds

Comma-separated list of place IDs.  Used to retrieve all offers related to each place indicated.

No

Comma separated list of Long values

—

4784745,90095856,6758798

startIndex

Page number of results to return (zero-based)

No

Integer

0

5

numberResults

Number of results per page

No

Integer

10

25

accountId

The id of an account which owns listings related to the requested offers. An accountId is required only when the authenticated user is an internal CGM user in order to set the account context for the operation. If the logged in user is an external user (i.e. not an internal CGM employee) the accountId should not be specified.

No (See Description)

Long

—

304998

The GET response will be the union of all offers related to the offerIds, placeIds, and externalPlaceIds indicated.

 

 

Request Headers

Header

Description

Required

Valid Values

Accept

Requested format for the response

Yes

application/json 
application/xml

authToken

Authentication Token from the Authentication API

Yes

Valid token

developerToken

The token received during registration

Yes

Valid token

 

Request Examples

Example 1: Get offers 122445872 and 121044952

 

curl -X GET \

    -H 'Accept:application/json' \

    -H 'authToken:mytoken' \

    -H 'developerToken:myDevToken' \

    'https://api.citygrid.com/advertising/offer/v3/get?offerIds=122445872,121044952'

 

Example 2: Get the second page of five offers from all of the offers related to externalPlaceId=666666

 

 

Example 4: Get offers 122445872 and 121044952 in addition to ones related to externalPlaceId=666666

 

 

Get Offer Response Properties

Field 

Description 

Type 

response

The structure and metadata for the entire response

(See complete response descriptions)

totalNumEntries

Integer

Total number of offers that match the criteria of the GET request across all pages

offers

Offer list

The offers returned from the search, each containing the data elements below

places

List of places associated to the Offer

Array of place objects (see Places grid above for details)

offerId

The id of the offer

long

title

The text/title of the offer

String