twilio / twilio-go

A Go package for communicating with the Twilio API.
MIT License
271 stars 40 forks source link

ConversationsV1.PageConversation does not work except for the first call #226

Open liangwen-anzx opened 5 months ago

liangwen-anzx commented 5 months ago

Issue Summary

ConversationsV1.PageConversation does not work when trying to fetch next page with a pageToken and pageNumber. It always return an empty result.

Cause of the problem: Conversations api returns a pageToken like PTclosed_2024-01-18T03:17:17.005Z_CHa09ace6334284f0aa7f988ebad3e231a while other endpoints return a hashed token like this ENZXlKbGRtVnVkRjlrWVhSbElqb3hOekEyTlRBek1qVTJNREF3TENKemFXUWlPaUpCUlRFek5tVXpOekJpTXpoak1tTTRPR1ptTVRRMU1EWXhNMk15TVRNME1HTXhJbjA9

The .005 inside Conversation pageToken will be eliminated in the SendRequest method in client.go which breaks the token.

Steps to Reproduce

1, call PageConversation method with empty pageNumber and pageToken 2, parse the response and get pageNumber and pageToken for next page 3, call PageConversation again with pageNumber and pageToken for next page.

Technical details:

tiwarishubham635 commented 1 month ago

Asking it to the downstream team

tiwarishubham635 commented 1 month ago

Need to check this regex, working on it