In OZmap, a client and their residence are represented by distinct elements. The "Client" element represents the person who subscribed to an internet service is represented by the "Client" element, and the residence where this client lives and where the internet service is installed is represented by the "Property" element. Therefore, the status of a customer is read and edited in the "Client" element in OZmap. The color of the icon representing the customer in OZmap is defined by their status, with two statuses currently available: "OK" (green icon) and "ERROR" (red icon).
...
To modify this client’s status, the update should be made using the _id
attribute of the "client" object, which in this example has the value 643d32be7112800014c3873f
, and we . We must pass the status 1
, which represents the "ERROR" status.
...
The expected response for this operation is an empty message with a "204 No Content" status, indicating that the client’s status was successfully updated.
Batch update
Also, there is a way to update the status of multiple clients simultaneously, which can be done through a batch update. For example, we’ll use the clients with the following IDs: 643d32be7112800014c3873f
, 6400e9c18a21020d261e7df1
, and 6400e9e28a21020d261e7e32
. Taking these IDs into account, the bulk update of those clients' status in OZmap can be performed as follows:
Code Block | ||
---|---|---|
| ||
curl --location 'https://sandbox.ozmap.com.br:9994/api/v2/ftth-clients/batch-update' \
--header 'Content-Type: application/json' \
--header 'Authorization: AUTHORIZATION_TOKEN' \
--data '{
"update": { "status": 1 },
"filter": [{
"property": "id",
"operator": "in",
"value": ["643d32be7112800014c3873f","6400e9c18a21020d261e7df1","6400e9e28a21020d261e7e32"]
}]
}' |
The expected response for this operation is an empty message with a “204 No Content” status, indicating that the clients’s status were successfully updated.