Retrieve the entity links for a given resource, entity type and entity. There are multiple endpoints available, depending on the entity type and whether or not you wish to retrieve for a specific entity (based on id).
This set of endpoints will retrieve all relationships for a given resource that are locations. Optionally, if a location ID is provided, it will only return those links for the given ID.
GET ~/resources/:resource-id/relations/locations
GET ~/resources/:resource-id/relations/locations/:location-id
It is also possible, for a specfic location, to retrieve any links to menu items for that location.
GET ~/resources/:resource-id/relations/locations/:location-id/menu/:pos-id
The same is possible for Apps, with a set of endpoints available to retrieve all App relationships for a given resource. Optionally, if an App ID is provided, it will only return those links for the given ID.
GET ~/resources/:resource-id/relations/apps
GET ~/resources/:resource-id/relations/apps/:app-id
POS vendors work the same way. Optionally, if a POS Vendor ID is provided, it will only return those links for the given ID.
GET ~/resources/:resource-id/relations/vendors
GET ~/resources/:resource-id/relations/vendors/:vendor-id
Parameters
Field | Type | Description |
---|---|---|
:resource-id | String |
The ID of the resource. |
:location-idoptional | String |
The hashed ID of the location. See Hashed Location IDs |
:pos-idoptional | String |
The |
:app-idoptional | String |
The ID of the App. |
:vendor-idoptional | String |
The ID of the POS Vendor. |
Response
Field | Type | Description |
---|---|---|
relations | Object |
An object describing each of the entity relationships for this resource. For example, a generic logo could be used by multiple locations, rather than each location having a duplicate image. Only the requested entity type of locations, apps, vendors or menuProductPosIds will be included in the response. |
locations | String[] |
A list of hashed location IDs linked to this resource. See Hashed Location IDs |
apps | String[] |
A list of App IDs linked to this resource |
vendors | String[] |
A list of Vendors IDs linked to this resource |
menuProducts | Object[] |
A list of menu products linked to this resource |
locationId | String |
The hashed location ID that is associated to the menu item. See Hashed Location IDs |
posId | String |
The |
Examples
Request: Retrieve locations for a given resource
GET https://sandbox.pos.doshii.co/v3/resources/lLf2X0k6/relations/locations
Response
{
"relations": {
"locations": ["2X3b8q", "hFG45jiX"]
}
}
Request: Retrieve a specific location for a given resource
GET https://sandbox.pos.doshii.co/v3/resources/lLf2X0k6/relations/locations/2X3b8q
Response
{
"relations": {
"locations": ["2X3b8q"]
}
}
Request: Retrieve specific menu items for a given resource
GET https://sandbox.pos.doshii.co/v3/resources/lLf2X0k6/relations/locations/2X3b8q/menu/pizza
Response
{
"relations": {
"menuProducts": [{
"locationId": "2X3b8q",
"posId": "pizza"
}],
}
}
Request: Retrieve apps for a given resource
GET https://sandbox.pos.doshii.co/v3/resources/lLf2X0k6/relations/apps
Response
{
"relations": {
"apps": [123, 789]
}
}
Request: Retrieve a specific App for a given resource
GET https://sandbox.pos.doshii.co/v3/resources/lLf2X0k6/relations/apps/123
Response
{
"relations": {
"apps": [123]
}
}
Request: Retrieve POS vendors for a given resource
GET https://sandbox.pos.doshii.co/v3/resources/lLf2X0k6/relations/vendors
Response
{
"relations": {
"vendors": [456, 675]
}
}
Request: Retrieve a specific POS vendor for a given resource
GET https://sandbox.pos.doshii.co/v3/resources/lLf2X0k6/relations/vendors/456
Response
{
"relations": {
"vendors": [456]
}
}
Comments
0 comments
Please sign in to leave a comment.