Creating conversations

Putting together the pieces of a conversation

Create the conversation

POST: /v1/messaging/conversations

A conversation can be created with 1 or more participants IDs. In most cases messages are used for 1:1 conversations, but a group chat can be facilitated by adding multiple participant IDs

{
  "participantUserIds": [
    "PARTICIPANT_ID_1",
    "PARTICIPANT_ID_2"
  ],
  "projectId": "PROJECT_ID",
  "externalResearcherId": "RESEARCHER_ID"
}

Add messages

POST: /v1/messaging/messages

A conversation ID is returned in the response and is required to add a new message to the conversation. Messages will go to all participants in a conversation. Responses from participants will be visible to all participants in the conversation.

{
  "conversationUid": "CONVERSATION_ID",
  "body": "Hi there!"
}

Adding new participants

POST: /v1/messaging/conversations/{uid}/participants/{participantUserId}

As noted above, additional participants can be added to a conversation to facilitate a group chat environment. Responses from participants will be visible to all participants in the conversation.

{
  "uid": "CONVERSATION_ID",
  "participantUserId": "PARTICIPANT_ID"
}