Retrieving Custom Data for a Location

Costum data can be retrieved independent of location or might be returned as part of location data.

Required Permission

can-retrieve-locations

See Auth* (scopes).

Standalone custom data

Request

GET /locations/<id>/customData

Response when custom data is json object

Given custom data is following json object

{
    "type": "shop",
    "capacity" : 5000
}

then response is going to be

HTTP/1.1 200 OK
{
   "type": "shop",
   "capacity": 5000,
   "links":[
      {
         "rel":"self",
         "href":"/locations/6b2e279d-8afd-4785-8ea4-b06739fb0f14/customData"
      },
      {
         "rel":"location",
         "href":"/locations/6b2e279d-8afd-4785-8ea4-b06739fb0f14"
      }
   ]
}

Response when custom data is not json object

Given custom data is a quoted string

"shop"

then response is going to be

HTTP/1.1 200 OK
{
   "value": "shop",
   "links":[
      {
         "rel":"self",
         "href":"/locations/6b2e279d-8afd-4785-8ea4-b06739fb0f14/customData"
      },
      {
         "rel":"location",
         "href":"/locations/6b2e279d-8afd-4785-8ea4-b06739fb0f14"
      }
   ]
}

Custom data as part of location data

Some of the location searchs will include custom data with the the other location data. Those searches mainly accept a retailer id as request parameter. If present then custom data will be attached to the field customData.

Given location search finds a location with the following custom data

{
    "type": "shop",
    "capacity" : 5000
}

then the response is going to look like following(lots of location properties removed for brevity)

[{
    "storeId":"002MKC",
    "storeName":"Milton Keynes",
    "customData": {
        "type": "shop",
        "capacity" : 5000
    }
}]

Failure

User doesn't have the required permission:

HTTP/1.1 403 FORBIDDEN

Location id doesn't match an existing location:

HTTP/1.1 404 NOT FOUND

Other errors:

HTTP/1.1 500 (internal server error)

results matching ""

    No results matching ""