Recipes · R8
Nightly reporting to a warehouse or BI tool
Every night, pull yesterday's conversation, messaging, SLA and staff numbers into your warehouse.
Goal: Dashboards in your own BI tool, up to date every morning.
What starts it
Your scheduled job
Your nightly job, after midnight in the workspace time zone.
Your values
Count days in this time zone.
Test mode (dry run): every step runs on your account, but nothing changes and nothing is sent.
- Step 1
Conversations
curl -X GET 'https://mcp.wa-api.cloud/v1/reports/conversations?preset=yesterday&timezone=Asia%2FDubai' \ -H "Authorization: Bearer $API_KEY"
- Step 2
Messages
curl -X GET 'https://mcp.wa-api.cloud/v1/reports/messaging?preset=yesterday&timezone=Asia%2FDubai' \ -H "Authorization: Bearer $API_KEY"
- Step 3
SLA breaches
GETSLA report
curl -X GET 'https://mcp.wa-api.cloud/v1/reports/sla?preset=yesterday&timezone=Asia%2FDubai' \ -H "Authorization: Bearer $API_KEY"
- Step 4
Staff, page by page
GETStaff report
Follow `next_cursor` until it is `null`.
curl -X GET 'https://mcp.wa-api.cloud/v1/reports/staff?preset=yesterday&timezone=Asia%2FDubai&limit=100' \ -H "Authorization: Bearer $API_KEY"
Passes on: next_cursor (from next_cursor)
Good to know
A metric that cannot be computed is
nulland listed inunavailable[]. Store it as missing, never as 0.
Validated against the API spec on every build