Alright @Emmad_Altaf got a lengthy response from the platform team
- If you only needs to get all messages from one thread, you can use
Return all Messages
endpoint and pass thethread_id
query parameter: Nylas v3 Email, Calendar, and Contacts API docs | Nylas Docs -
- If you only needs to get the number of messages from one thread, you can use
Return a thread
endpoint. There is a field calledmessage_ids
in the response. The number of messages is the size ofmessage_ids
array: Nylas v3 Email, Calendar, and Contacts API docs | Nylas Docs
- If you only needs to get the number of messages from one thread, you can use
-
- We do not support expanding message bodies for
Return all threads
, because the pagination will become very complex. We will have to paginate both the messages in each thread, and the thread list itself.
- We do not support expanding message bodies for
-
- However, there is a way to get around this problem. You can call
Return all Threads
first. For each thread returned, then expand the messages by making anotherReturn all messages
call.
- However, there is a way to get around this problem. You can call
Hope this helps