💡 Within the RAY model, physical places are modeled as stores, which are grouped into companies.
Most API services will need to indicate which store(s) or company(s) they should operate from.
Given an API user, and once the token is obtained , the following services must be consumed to obtain the companies and stores for which they have permissions.
1.- First, we need information from the API user, particularly the id:
Answer: administrator information
{
"data": {
"id": 1746,
"name": "",
"lastName": "",
"email": "gustavo@botbit.io",
"avatar": null,
"username": "BYfwlBtNZRh9lREJ8TGnDnEPcui89JGaWkrlwhq8",
"fullName": "gustavo@botbit.io",
"active": true
},
"result": "success",
"message": "ok",
"statusCode": 200
}
2.- Then, with the administrator id (1746 in the example) we can consult the stores and companies of the API user.
Answer: list of stores
{
"data": [
{
"id": 1520,
"name": "RAY test1",
"companyId": 3,
"storeCategory": {
"id": -1,
"name": "BotBit",
"cronExecution": 68400000,
"isSuscription": false
},
"logo": "3/91399f8e-f49a-4c8e-9328-dbe59e40057a.svg",
"locality": "",
"province": "CABA",
"feedback": true,
"caption": true,
"marketing": true,
"companyHotBotId": "5e9e11b14933740028bf9118",
"status": "ACTIVE",
"country": "AR"
},
{
"id": 2049,
"name": "RAY Facebook",
"companyId": 3,
"storeCategory": {
"id": -1,
"name": "BotBit",
"cronExecution": 68400000,
"isSuscription": false
},
"logo": "3/91399f8e-f49a-4c8e-9328-dbe59e40057a.svg",
"locality": "",
"province": "CABA",
"feedback": true,
"caption": true,
"marketing": true,
"companyHotBotId": "5e9e11b14933740028bf9118",
"status": "ACTIVE",
"country": "AR"
}
],
"result": "success",
"message": "ok",
"statusCode": 200
}
Answer: list of companies
{
"data": [
{
"id": 3,
"name": "RAY",
"logo": null,
"country": "US",
"locale": "en_US",
"fromEmail": "info@botbit.io",
"replyTo": "info@botbit.io",
"companyNameForCampaigns": "Botbit",
"companySegmentId": 1,
"emailPlanLimit": null,
"wtInterval": null,
"isQrRedeem": false,
"facebook": "https://www.facebook.com/My-Location-Test-427745421368320/?modal=admin_todo_tour",
"youtube": "https://www.youtube.com/channel/UCqa41iOnrddK13zx-_ze8Lg",
"twitter": "https://www.twitter.com/botbitapp",
"pinterest": "https://www.pinterest.com/{your_pinterest_id}",
"restorando": null,
"instagram": "https://www.instagram.com/deandennys/?hl=es-la",
"urlPrefix": "botbitresto",
"bgMobile": "https://admin3.botbit.io/static/img/stores/3/bca7a088-7579-477d-80f6-f3c51d7b5107.gif",
"bgDesktop": "https://admin.botbit.io/static/img/stores/3/15905033018261587421792952coffee-shop-2-1326513-min%20(1).jpg",
"useDeviceLocation": true,
"storeSelectorLabel": "¿En qué tienda de BotBit te encontrás en este momento?",
"urlPrefixForQr": "botbitcompany2"
}
],
"result": "success",
"message": "ok",
"statusCode": 200
}
Related Posts
Visit our Help Center , there you will find more information to continue learning about the platform.
What do you think of this article? 👇