This replit shows how to use the data export API and the cards API to find out which bits of content where sent to which clients having which labels.
- Click the
Run on Repl.it
button above and install this example into your Repl.it workspace. - Get a Turn token and add it as a secret called
TOKEN
in Repl.it - Optionally, set the
TOKEN
variable if your Turn instance is on a private cloud. If not, it will default to connect tohttps://whatsapp.turn.io
. - Send a message to your number by selecting a card in the Turn UI which has one or more labels assigned.
- Run this replit.
It will do the following:
- Use the Data Export API to retrieve messages from the last 24 hours
- It will select outbound messages which have a
card_uuid
- Find the relevant card for the UUID using
/v1/cards/<uuid>
- Print a summary of cards used and labels on said card.