FlyFishFinder API

Chat (Twilio)

This API is responsible for executing data interactions across the Twilio COnversations Integration.

Twilio Token

POSTGet Twilio User Token

/api/chat/getTwilioToken

Body

  • uid: uid of user

Retrieves the Twilio token associated with the passed UID. This is useful for authenticating the user with Twilio.

Twilio User

POSTGet User

/api/chat/getUser

Body

  • uid: uid of user

Retrieves the Twilio user associated with the passed UID

POSTUpdate User

/api/chat/updateUser

Body

  • user: Updated Twilio User Object

Updates the Twilio user object with the passed user object. This is useful for updating the user's attributes.

POSTCreate User

/api/chat/createUser

Body

  • uid: uid associated with Firebase User
  • userName: User name for the Twilio User

Creates a Twilio user with the specified UID and user name. This is useful for creating a Twilio user for a Firebase user.

Twilio Conversations

POSTGet User Conversations

/api/chat/getUserConversations

Body

  • uid: uid to retrieve conversations

Retrieves the conversations associated with the passed UID. This is useful for retrieving the user's chat history.

POSTCreate Conversation

/api/chat/createConversation

Body

  • uid: uid to create conversation for
  • conversationParticipants: array of participants to add to the conversation
  • conversationName: name for conversation, used more for group chats

Creates a conversation with the specified participants. This is useful for creating group chats.

POSTAdd Conversation Participant

/api/chat/addConversationParticipant

Body

  • conversationSID: id of conversation to add participant to
  • uid: uid of the user to add

Adds a participant to the specified conversation. This is useful for adding users to group chats.

POSTGet Conversation Participants

/api/chat/getConversationParticipants

Body

  • conversationSID: id of conversation to retrieve participants from

Retrieves the participants associated with the passed conversation SID. This is useful for retrieving the participants of a group chat.

POSTCreate Conversation Message

/api/chat/createConversationMessage

Body

  • conversationSID: id of conversation to create a message for
  • message: message to create

Creates a message for the specified conversation. This is useful for sending messages in a conversation.

POSTGet Conversation Messages

/api/chat/getConversationMessages

Body

  • conversationSID: id of conversation to retrieve messages
  • pageNumber: optional - page number for paginated results (default: 0)
  • pageToken: optional - token for retrieving specific page (default: null)

Retrieves the messages associated with the passed conversation SID. This is useful for retrieving the chat history of a conversation.

POST Mark Conversation Messages Read

/api/chat/markConversationMessagesRead

Body

  • conversationSID: id of conversation to mark as read
  • participantSID: id of the participant (user) who read the messages

Marks all messages in a conversation as read for a specific participant. This updates the lastReadMessageIndex for the participant.

POST Delete All User Conversations

/api/chat/deleteAllConversations

Body

  • uid: user id to delete all conversations for

Deletes all conversations associated with the specified user. This is useful for removing a user's conversation history completely.