0
votes

I am trying to export the contents of a chat channel in Twilio Programmable Chat for a client's records. Twilio limits to batches of 100 messages, however I can't figure out how to page through the results, i.e. get messages 101-200.

$messages = $twilio->chat->v2->services("my_service_id")->channels('my_channel_id')->messages->read([],100);

I can't seem to find any documentation on doing this in PHP either, but the above returns the first 100 messages of the channel.

1

1 Answers

1
votes

Finally found the docs. Accepted argument list for the read() function here

Solved with:

$messages = $twilio->chat->v2->services("my_service_id")->channels('my_channel_id')->messages->read([],null,20);

which returned all channels messages.