Overview


The Airport Lounge Locator accurately identifies airport lounges that participate in the Diners Club International Lounge program.

Authentication-Making the first API request is only few steps away


  1. All projects start in Sandbox mode. Once you’re invited to gain access to this API you can login here to get Client Application ID (API Key) Client Application Secret, Consumer Application Certificate and API Plan name.

  2. All API requests must be authenticated with an OAuth token. To get the OAuth token, follow these simple steps

    1. Make a HTTP POST request to the endpoint /auth/oauth/v2/token with HTTP Authorization Header as Basic base64encoded(client_application_id:client_application_secret), Content-Type as application/x-www-form-urlencoded and Cache-Control as no-cache

    2. The response would contain an OAuth token along with token type and token expiry in seconds

      SAMPLE OAUTH TOKEN REQUEST

      POST /auth/oauth/v2/token?grant_type=xyz&scope=RWDS_xyz HTTP/1.1
      Authorization: sdlfsdf0dskladfk123456
      Content-Type: application/x-www-form-urlencoded
      Cache-Control: no-cache

      SAMPLE RESPONSE

      Response-Status: HTTP/1.1 200 OK
      Cache-Control: no-store
      Content-Type: application/json;charset=UTF-8
      Pragma: no-cache
      {
      "access_token": "sdlfsdf0dskladfk123456"
      "token_type": "xyz"
      "expires_in": 3600
      "scope": "RWDS_xyz"
      }

  3. Once an OAuth token is obtained, you can use the token along with Consumer Application Secret and API Plan name provided during Sandbox access in the HTTP Header of an API to make your first call. The same OAuth can be used for multiple API calls as long as it is not expired.

Access Error


In case of missing or incorrect credentials, the server will return HTTP Status code 401 Unauthorized.

In case access to the resource identified by URI is forbidden for some reason, the server will return HTTP Status Code 403 Forbidden.

In case of invalid JSON structure, the server will return a HTTP Status Code 400 Bad Request.

In case of valid JSON structure but some validation error is found, the server will return HTTP Status Code 400 with validation errors in the responseheader.

In case of an unexpected error or downstream system unavailable, the server will return HTTP Status Code 500.

API Structure


A typical API request would contain the sections HTTP Header, Request Header, Request Body as part of the request and HTTP Header, Response Header and Response Body as part of the response with some exception due to the nature of the API. Refer the individual end points to know more.

HTTP Header


We follow a robust standard for HTTP Header which includes the following parameters to be supplied while you are making an API request

Accept
Content-Type
Authorization
X-DFS-API-PLAN
While Accept, Content-Type and Cache-Control values are standard, Authorization which is the OAuth token obtained while authenticating and X-DFS-API-PLAN which is API Plan name given to you at the time of registration to the Sandbox. Our HTTP Header in the response will include Access, Content-Type and Cache-Control.

HTTP Status Codes


< p class="Add-any-number-of-he Add-paragraphs-as-de"> The HTTP Status Code returned in the response follows an industry API standard and designed to help you better interpret the underlying error.
In case of a successfully processed request, the server will return HTTP Status Code 200.
In case of missing or incorrect credentials, the server will return HTTP Status code 401 Unauthorized.
In case access to the resource identified by URI is forbidden for some reason, the server will return HTTP Status Code 403 Forbidden.
In case of Internal Server Error, the server will return a HTTP Status Code 501.
In case of Service Unavailable, the server will return a HTTP Status Code 503.

dci-lounges/cities

/dci-lounges/v2/cities


Returns a list of all cities currently referenced in the lounge data

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

country:

Country name

lang:

Language

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-lounges/v2/cities?country=italy&lang=en-us
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of city objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "184"
{
"result": [
{
"_id": {
"city": "Bologna"
}
},
{
"_id": {
"city": "Catania"
}
},
],
"ok": 1
}

dci-lounges/countries

/dci-lounges/v2/countries


Returns a list of all countries currently referenced in the lounge data

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lang:

Language

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-lounges/v2/countries?lang=en-us
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of country objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "906"
{
"result": [
{
"_id": {
"city": "Albania"
}
},
{
"_id": {
"city": "Angola"
}
},
],
"ok": 1
}

dci-lounges/facilities

/dci-lounges/v2/facilities


Returns an array of facilities codes and their full string

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lang:

Language

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-lounges/v2/facilities?lang=en-us
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of facilities objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "307"
{
"result": [
{
"lang": "en-us",
"token": "NEWSMAG",
"string": "Newspapers & Magazines"
},
{
"lang": "en-us",
"token": "CNN",
"string": "CNN"
},
],
"ok": 1
}

dci-lounges/healthcheck

/dci-lounges/v2/healthcheck


API monitoring ping

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-lounges/v2/healthcheck
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "307"
{
"ok": 1
}

dci-lounges/lounges

/dci-lounges/v2/lounges


Returns lounges based on the passed in parameters

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lat:

Latitude

lng:

Longitude

radius:

Radius in miles

country:

Country slug

city:

City slug

since:

Date YYYY-MM-DD

lang:

Language

page:

Results page

pagesize:

Results per page

sortby:

Sort by field

sortdir:

Sort direction

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-lounges/v2/lounges?radius=20&city=chicago&lang=en-us&sortdir=asc
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of lounge objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "956"
{
"result": [
{
"dci_code": "US016",
"facilities": "AIRCON,ALCOHOL,DISABLE,DMC,NEWSMAG,NOSMOKE,REFRESH,TEL,WIFI",
"telephone": "44 (0)208 865 3222",
"fax": "N/A",
"lounge_name": "Air France - KLM Lounge",
"airport_name": "Chicago IL O Hare Intl",
"country": "United States",
"city": "Chicago",
"terminal": "International Terminal 5",
"location": "Airside - after Security Checks turn right. The lounge is located between Gates M8 and M7 on the left hand side. International flights from T5 only.",
"marketing_copy": "",
"opening_hours": "08:15 - 00:00 daily.",
"conditions": "Maximum 3 hour stay - Children under 2 years are admitted free - Smart casual dress at all times (no shorts, vests, baseball caps or football shirts allowed).",
"additional": "",
"terminal_accessibility": "",
"updated_at": "1512423883",
"lounge_status": "Open",
"comments": "",
"guest_currency": "USD",
"guest_fee_rate": "28",
"fee_notes": "",
"slug": "air-france-klm-lounge",
"provider": "LG",
"point": [
-87.9,
41.97

],
"favorite_count": "0",
"rating_count": "37",
"rating_average": "4.1351351351351"
},
],
"ok": 1
}

lounges/lounges/{dcicode}

/v2/lounges/{id}


Fetch a lounge by its DciCode

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

id:

DciCode

lang:

Language

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-lounges/v2/lounges/UH002?lang=en-us
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of lounge objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "184"
{
"result": [
{
"dci_code": "UH002",
"facilities": "AIRCON,ALCOHOL,DISABLE,DMC,NEWSMAG,NOSMOKE,REFRESH,TEL,WIFI",
"telephone": "44 (0)208 865 3222",
"fax": "N/A",
"lounge_name": "Galilei VIP Lounge",
"airport_name": "Pisa Galileo Galilei Intl",
"country": "Italy",
"city": "Pisa",
"terminal": "",
"location": "Airside - after Security Control, the lounge is located on the 1st Floor of Departures.",
"marketing_copy": "",
"opening_hours": "06:00 - 21:00 daily (Winter).
06:00 - 22:00 daily (Summer).
Lounge may close 40 minutes prior to scheduled flight departure."
,
"conditions": "Children under 4 years are admitted free.",
"additional": "",
"terminal_accessibility": "",
"updated_at": "1494867729",
"lounge_status": "Open",
"comments": "",
"guest_currency": "EUR",
"guest_fee_rate": "24",
"fee_notes": "",
"slug": "galilei-vip-lounge",
"provider": "LG",
"point": [ 10.39, 43.68 ],
"favorite_count": "0",
"rating_count": "37",
"rating_average": "4.1351351351351"
},
],
"ok": 1
}

lounges/lounges/favorite

/dci-lounges/v2/lounges/favorite


Favorite a lounge

REQUEST ARGUMENTS


id: string | mandatory

DciCode of lounge

ref_id: string | mandatory

Unique identifier of favorite creator

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

POST https://apis.discover.com/dci-lounges/v2/lounges/favorite
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82" {
"id": "UH002"
, "ref_id": "abc123"
}

RESPONSE VALUES


result: Object | mandatory

Object with current count property objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "80"
{
"result": {
"count": "1"
},
"ok": true
}

lounges/lounges/rating

/dci-lounges/v2/lounges/rating


Add a rating 1-5 to a lounge

REQUEST ARGUMENTS


id: string | mandatory

DciCode of lounge

ref_id: string | mandatory

Unique identifier of favorite creator

rating: string | mandatory

Rating number 1-5

feedback: string | optional

Preformatted feedback

comments: string | optional

General comments

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

POST https://apis.discover.com/dci-lounges/v2/ratingContent
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82" {
"id": "UH002"
, "ref_id": "abc123"
"rating": "3"
}

RESPONSE VALUES


result: Object | mandatory

Object with current rating_count and rating_average properties

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "80"
{
"result": {
"rating_count": "1",
"rating_average": "3"
},
"ok": true
}

Errors


Header Level Error Codes

Error Message HTTP Status Code
Internal Server Error 500
Service Unavailable 503
UnAuthorized 401
Forbidden 403
Bad Request 400