Fuse5 Get Locations
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | 03.04.2025 | Bogomil | First publish |
v1.1 | 05.06.2025 | Bogomil | Store only unique records |
Get Locations
We want to introduce a new button in Fuse5 Connector called “Get Locations” which once clicked to trigger the request.
We want to introduce toast for successful start of the process or error when there is a missing info and the process cannot start for example missing API Key or URL.
API Docs : https://greenteam.fuse5live.com/f5apidoc/standalone/#api-Location-Get_All_Locations
API Call : location/all
Sample Request:
{
"authenticate":{
"apikey":"API KEY"
},
"services":[{
"call":"location/all",
"identifier":{
"offset":"0",
"limit":"20",
"sort_order":"desc"
}
}]
}
Sample Response:
{
authenticate: {
userame: "Fuse5TestUser",
status: "success"
},
services: [
{
request: {
call: "location/all",
params: null,
identifier: null
},
response: {
status: true,
msg: {
code: "M003",
msg: "Data retrieved successfully"
},
data: [
{
id: "3067944",
location_name: "Fayetteville"
},
{
id: "3067945",
location_name: "Wilmington"
},
{
id: "3067946",
location_name: "Raleigh"
},
{
id: "3067947",
location_name: "Lumberton - Watts Rd."
},
{
id: "3067948",
location_name: "Lumberton - Etwn Rd."
},
{
id: "3067949",
location_name: "St. Pauls"
},
{
id: "3067950",
location_name: "Pembroke"
},
{
id: "3731166",
location_name: "Elizabethtown"
}
]
}
}
]
}
From the response we want to store the id
and location_name
as an enumeration for Channel Fuse5 Connector > Fuse5 Location. We want to display the name of the location with prefix of the Fuse5 Connector > Name and send the name.
When we click on the button we want to delete all existing locations for the specific connector and store the new ones.
<v1.1>Please note we want to add only the unique location_name
</v1.1>
Sample Error Response:
{
"authenticate": {
"apikey": null,
"status": "failed",
"error": {
"code": "E101",
"message": "JSON Error: Syntax error, malformed JSON"
}
}
}
We do not want to store the errors for the Get locations but to return them in the log.