I am using the WHM api to track emails in the mail delivery log, however, the JSON response using emailtrack_search return no records
I am calling the following URL
1xx.x.xx.xxx:2087/cpsess####/json-api/emailtrack_search?api.version=1
And this is the JSON response
{"metadata":{"result":1,"version":1,"command":"emailtrack_search","reason":"OK","overflowed":0,"__chunked":1},"data":{"records":[]}}
Notice that the records are empty, but i have messages in the email delivery log, I tried adding a user as parameter but it returns the same.
Does anybody know how to show email delivery logs using this API?
I would really appreciate any help
Best regards.
2
Answers
This thread might help you. Also you can ask for request on cPanel forums. There are a lot of active users there:
https://forums.cpanel.net/threads/track-delivery-api.534501/
Daniel, the empty records array was driving me crazy as well. Your findings helped me dig deeper into cPanel’s badly documented API. To help others looking for similar answers, I detailed the process in a blog post – Email delivery reports using WHM API and PHP
Edit: Here’s a piece of my code that returns results from WHM’s JSON API, using emailtrack_search: