No `limit` when getting all messages in a thread
Using the REST API to fetch all the messages in a thread. I call:
const messageData = await fetch("https://api.cord.com/v1/threads/<my thread id>/messages?sortDirection=ascending");
That works fine. But I also want to specify a limit. Some of the threads I need to fetch have hundreds or thousands of messages. I would use the /messages API, but I don't see a way to specify the thread ID?
Ah, interesting. It looks like you may have found an awkward spot in our APIs. Let me double check with some other folks on the team and see what the options are here.
thanks
Hi @Hyunwoo Kim, following up here. You're absolutely right that this is missing from our current API. We'll see if we can get this added to the API soon. In the mean time, would you be able to use the /messages API and find the messages that you need using location and/or metadata filters? That's the best we can do for the moment.
Is there a way to use metadata for this? 🤔
Absolutely. A simple way to do this would be to put the thread ID as a field in the metadata. It's duplicating data, but it should work fine.
Yeh I can do that. thanks.