...
From here, we will assume that you understood understand the difference between these two feasibility types. If you have any questions, don't hesitate to contact the OZmap support team.
...
Below there's a flow to facilitate the understanding:
...
Using the information returned by OZmap, the chatbot can decide what to inform the customer.
🔗 API
The next step is to understand figure out how to call OZmap and get the feasibility information at a specific address.
Here is an example:
After identifying the customer as new, we have the customer’s address. For this example, let’s assume the address is: 720 Michigan Avenue, Chicago, IL -- 60605, United States
. However, the API only accepts latitude, longitude, and radius, so they must be provided.
To get the latitude and longitude of an address, click on this tutorial.
The latitude and longitude being: 41.87252057124877, -87.62489949084207
, and radius: 100
, the query to OZmap would be made like this:
Code Block | ||
---|---|---|
| ||
curl -X
GET "https://sandbox.ozmap.com.br:9994/api/v2/ftth-viability?radius?lat=41.87252057124877&lng=-87.62489949084207&radius=100" /
--header 'authorization: AUTHORIZATION_TOKEN' |
The expected response for this lat and long is:
Code Block | ||
---|---|---|
| ||
{
"viable": true,
"boxes": [
{
"distance": 30.41,
"name": "CTO 22-05",
"id": "5dc06d1275fc7d0006732521",
"project": "5d51a87046cbe700148328bf",
"lat": 41.87252057124877,
"lng": -87.62489949084207,
"implanted": true,
"availability": 6,
"horizontal_condos": []
}
],
"refused_boxes": [],
"properties": [
{
"id": "6168210a1692a900135b628d",
"address": "720 Michigan Avenue, Chicago, IL -- 60605, United States",
"observation": "This property was disconnected when a new client was created in this box. The previous connection for this property, identified as 'SS 22-05 - Port 2,' now belongs to client 38742|217968.",
"lat": 41.87252057124877,
"lng": -87.62489949084207,
"box": "5dc06d1275fc7d0006732521",
"project": "5d51a87046cbe700148328bf",
"horizontal_condos": []
}
]
} |
Note that in response the viable information is marked as “true”.
With this information, the Chatbot could, for example, give a standard response to the customer, indicating that there's availability to sign up for a plan at their address. If they are interested, they could be directed to contact the provider's sales department or make a reservation using the viable options.