How to get the number of users affected by a broadcast June 17, 2023 01:09 Updated Index: Search all appointments Collect the ID of the broadcast you want to get the information Search for information about a specific schedule The Blip scheduling module is a powerful tool for engaging users in a bot. Through it, it is possible to schedule the launch of messages (broadcasts) for a previously defined list of users. By default, every bot already has a user list called All Users, which contains any user who has talked to the bot, at least once regardless of the channel. To make an appointment access the Portal, choose your bot and in the top menu choose more options and then click on Scheduler. After making a broadcast it is very important to analyze the assertiveness of the shot. For this it is necessary to make some requests in the Blip API (via HTTP requests or via commands in the SDKs). Search all appointments Request method: POST Note: Use the url with the contract id to consume the endpoints reported below, its performance and operation may be impacted if it does not have the contract id, so it is essential to use the url with the contract id to use http requests! URL: https://{{contractid}}.http.msging.net/commands Headers: Key: Authorization Value: Key API-KEY-BOT Body: JSON with the command that fetches all schedules, according to the LIME protocol (check out more information about Blip extensions here) { "id": "640aaaca-499a-4b21-8375-1e005b0fa583", "method": "get", "to": "postmaster@scheduler.msging.net", "uri": "/schedules?since=2018-04-18T00:00:00.938Z&$skip=0&$take=100"} The since parameter defines a filter for the start date of the survey, that is, only the appointments made from March 18th will be returned. The skip parameter defines the number of schedules to be disregarded (used for pagination). The Blip parameter defines the number of appointments to be returned. Collect the ID of the broadcast you want to get the information The return of the request made in step 1 will return a list of schedules with the ID of each scheduled message. Analyze the items' property contained in the response returned by the server and choose which of the schedules you want to obtain the information. See an example of return below: { "id": "640aaaca-499a-4b21-8375-1e005b0fa583", "from": "postmaster@scheduler.msging.net/#az-iris3", "method": "get", "resource": { "total": 3, "itemType": "application/vnd.iris.schedule+json", "items":[ { "when": "2018-05-18T16:37:35.900Z", "status": "executed", "message": { "content": "Some text", "from": "assistentedeastronomia@msging.net", "id": "30385066-a00c-423c-b254-0debc51093f8", "pp": "postmaster@scheduler.msging.net/assistentedeastronomia%40msging.net", "to": "assistentedeastronomia+senders@broadcast.msging.net", "type": "text/plain" } }, ... ], }, "status": "success", "to": "bot@msging.net/default", "type": "application/vnd.lime.collection+json"} The value 30385066-a00c-423c-b254-0debc51093f8 represents the message ID that was scheduled. The node assistentedeastronomia+senders@broadcast.msging.net, which identifies the list to which the schedule was addressed. Search for information about a specific schedule With the ID of the scheduled message and the list identifier for which the schedule was made, just make a request to search for the information related to the respective broadcast. The example below shows an example of this request: Request method: POST Note: Use the url with the contract id to consume the endpoints reported below, its performance and operation may be impacted if it does not have the contract id, so it is essential to use the url with the contract id to use http requests! URL: https://{{contractid}}.http.msging.net/commands Headers: Key: Authorization Value: Key API-KEY-BOT Body: JSON with the command that fetches all schedules, according to the LIME protocol (check more information about Blip extensions here) { "id": "829044c9-3c97-46fd-9dc0-6a8ce0dbca3c", "method": "get", "to": "postmaster@broadcast.msging.net", "uri": "/lists/assistentedeastronomia%2Bsenders%40broadcast.msging.net/messages/30385066-a00c-423c-b254-0debc51093f8"} The value assistedtronomy% 2Bsenders% 40broadcast.msging.net represents the identifier of the list used for scheduling (collected in step 2), encoded in URL format. The value 30385066-a00c-423c-b254-0debc51093f8 represents the message ID that was scheduled (collected in step 2). The result of this request has detailed information about a specific schedule. The JSON below presents an example of the result of the above request: { "from": "postmaster@broadcast.msging.net/#az-iris3", "id": "829044c9-3c97-46fd-9dc0-6a8ce0dbca3c", "method": "get", "resource":{ "id": "30385066-a00c-423c-b254-0debc51093f8", "status": "processed", "statusDate": "2018-05-18T16:37:42.420Z", "consumed": 0, "failed": 0, "received": 0, "recipients": 2, "sent": 2 }, "status": "success", "to": "assistentedeastronomia@msging.net/default", "type": "application/vnd.iris.distribution-list-message+json"} The most important information about each schedule is inside the object resource. Status Description consumed The number of analysis to be skipped failed The number of analysis to be returned received Number of messages received recipients Number of users in the list sent Number of messages sent during the broadcast For more information, visit the discussion on the subject in our community or the videos on our channel. 😊 Related articles Builder variables Analyzing Active Message Dispatches via WhatsApp How to reset users through Beholder? How to use Recurring Notifications in Messenger? (Recurrent Notifications) How to Send SMS via API