Port reservations in OZmap are made after the ERP completes a new sale. For this, a feasibility study is necessary to check the availability of boxes for the client.
Below, we will provide an example of how you can use the OZmap API to reserve a port in a box in OZmap for a client who wishes to sign up for the provider's service.
We assume that this concept is clear to you. If you still have any questions, please get in touch with our support team.
To simplify understanding, we will create a sample scenario using the scope of a Chatbot/IVR.
Initial Scenario
According to the example above, let’s assume there’s a request for a new client that is already eligible for the sale.
➡️ Example
A client, wishing to subscribe to a service from the provider, accesses the portal and contacts the provider's support via WhatsApp.
At this point, the provider's chatbot will request the client's address information.
After identifying the available box and obtaining the identification code, the chatbot will reserve a port in the located box, connecting the client to the first available port found.
Below is a flow to facilitate understanding:
Using the information provided by OZmap, the Chatbot can decide what to return to the client.
🔗 API
The next step is to understand how the request has to be done to retrieve information about a port reservation for a specific client.
Follow the example below:
After identifying the code that represents the available box to insert the client into the OZmap project, for this example, we'll assume the box code is: 5da62201493d9c00066655b8
.
We also need the address's latitude and longitude to insert the customer. This tutorial will help you retrieve these.
With the box code: 5da62201493d9c00066655b8
, lat: -27.5782336721312
, and lng: -48.527442812919624
, the reservation in OZmap can be made like this:
curl --location --request \ POST "https://sandbox.ozmap.com.br:9994/api/v2/properties" --data-raw '{ "address": "R. Delminda Silveira, 900 - Agronômica, Florianópolis - SC, 88025-500", "lat": -27.5782336721312, "lng": -48.527442812919624, "observation": "Reserva de Porta", "box": "5da62201493d9c00066655b8", "auto_connect": true, "force": true, "client": { "certified": false, "implanted": false, "status": 0, "observation": "Reserva do Novo Cliente", "code": "123|123", "name": "Gabriel Marioto" } }' --header 'authorization: AUTHORIZATION_TOKEN'
Attention! The authorization token must be created at the OZmap interface. For more information, click here.
Use auto_connect = true to automatically connect the properties to a connector within a box. It is mandatory that the connector “Allows client connection” and is available, beyond being attached to a PON port.
Use force = true to force the connection with any connector that “Allows client connection”, even if it’s not attached to a PON port.
The expected return to that port reservation is:
{ "observation": "Reserva de Porta", "drop": "62d194b56c9401002392c706", "tags": [], "cables": [], "kind": "Property", "address": "R. Delminda Silveira, 900 - Agronômica, Florianópolis - SC, 88025-500", "coords": [ -48.527442812919624, -27.5782336721312 ], "box": "5da62201493d9c00066655b8", "client": "62d194b46c9401002392c701", "creatorData": { "id": "628f8c3269a79101db8b407b", "name": "teste_integracao", "username": "teste_integracao" }, "project": "62bc9b89a17d2b0030bddc0c", "pole": "5da62201493d9c00066655b1", "history": { "clients": [ { "id": "62d194b46c9401002392c701", "code": "123|123", "enter_date": "2022-07-15T16:24:20.976Z", "exit_date": null } ] }, "createdAt": "2022-07-15T16:24:20.980Z", "updatedAt": "2022-07-15T16:24:20.980Z", "id": "62d194b46c9401002392c704", "lng": -48.527442812919624, "lat": -27.5782336721312, "disconnect_property": false }
Notice that the information about the reservation was returned, which means that it was successfully performed.
With that information, the Chatbot could, for example, provide a standard answer to the client, indicating that the reservation was created and the team is aware. This also avoids the need to contact an agent directly.
0 Comments