I am trying to figure out how to be able to show the user a list of delivery logs related to the specific message they sent out. Right now I can't seem to find a way of grouping the logs, short of basing it off of a date and time and maybe anything within 5 minutes of the time it was sent. This is because it assigns a different message and request ID to each number that message was sent to. But is there a better way?
Asked
Active
Viewed 165 times
1 Answers
1
- Go to Plivo > SMS > Logs
- Download logs
- Open with Notepad++
- ???
- Filter as you please.
Otherwise, check API documentation.
The Plivo webapp offers these filters: "From/To/Direction/Status/Error/Timeframe" as per: snag.gy/P6sRNH.jpg
Also, if you mean to display to the user programatically through REST API, I think you should make an app with the following flow:
- auth api
- fetch all logs (maybe pass a value of last time they sent messages + 14 days... if that is saved somewhere) > URI: /v1/Account/YOURACCOUNTMX3$cD../Message/
- Search by Params : { text : Your Text Here
-
Doesn't answer my OP. I know about the API, my question is related towards grouping the logs on something other than time. At the moment I've increases it to 1 day as Plivo has a bug in their API when adding datetime lte and gte. – Travis Johnston Aug 02 '19 at 00:35
-
You can group them by "From/To/Direction/Status/Error/Timeframe" as per: https://snag.gy/P6sRNH.jpg – Aug 02 '19 at 01:07
-
I mean... can you identify any other "sort-able" pattern(s) that you can use as a angle to code what you need? Could you not download the whole logs, and parse the .csv or .json, then filter the elements/variables and output say: "All lines with > THEMESSAGE"? – Aug 02 '19 at 01:14
-
Well my application will be sending out to upwards of thousands of contacts. Since the API creates a separate Message UUID there is no source or group ID to narrow the results. Im store a message log locally in DB for each sent so I could just pull a log for that UUID only, but thousands of API calls for a single instance and then that for every customer... – Travis Johnston Aug 02 '19 at 01:18
-
Part of the problem is the limit of 20 too, but I could maybe grab the log CSV programmatically instead of the API... – Travis Johnston Aug 02 '19 at 01:19
-
If you need to send to say, 100 customers, download all logs and debug logs, filter them by messages via Param : { text : THETEXT }. A full plivo log of 100k SMS sent weight about 50mB. Simply have this log on the server where you call the api from, when USER9281 requests his logs for his specific messages, make a script fetch all logs with Params : { text : USER9281SMSTEXT } – Aug 02 '19 at 01:44