0

When I try to fetch a closed Twilio Conversation on the frontend (using JS SDK) I get a "Not found" error.

Is it possible to fetch closed conversations?

My goal is to allow the user to close a conversation, but still be able to access the message history, while not being allowed to send new messages etc.

EDIT: Adding code snippet to show how Im retrieving the conversation (this is a method on a Javascript class):

public async loadConversation(conversation: ConversationModel) {
  try {
    const twilioConversation = await this.getClient().getConversationByUniqueName(
        conversation.name
    );
    } catch (e) {
      console.error(e);
    }
  }
philnash
  • 70,667
  • 10
  • 60
  • 88
Lee Overy
  • 437
  • 5
  • 13
  • How are you trying to load the conversation, can you share your code? – philnash Aug 28 '22 at 23:41
  • Hi. The conversation loads perfectly when its in an active state. But soon as the state is changed to closed, it then fails to retrieve the conversion. – Lee Overy Aug 29 '22 at 09:10
  • I am still investigating this, but I believe that you’ll only be able to retrieve active and inactive conversations from the JS SDK, and if you want closed conversations you’ll need to use the Participant Conversation REST API. I’m trying to confirm this and get it documented. – philnash Aug 29 '22 at 09:31
  • Retrieving via the js sdk would be preferable. I still want the participants to see message history - just not be able to send new messages. Closed shouldn’t mean inaccessible imo. That would be deleted – Lee Overy Aug 29 '22 at 20:51

1 Answers1

0

In testing internally we found that requesting a closed conversation by unique name does result in the error that you are seeing.

However, using getConversationBySid(conversationSid); does work and returns the closed conversation.


Further, we are now looking into why this is different between getConversationBySid and getConversationByUniqueName.

philnash
  • 70,667
  • 10
  • 60
  • 88