Retrieve Conversation Id

Use this API to get the conversation ID

JSON Parameter Description:

Parameter

Required

Description

topicId

Yes

Topic id of the conversation

topicDetail

Yes

Topic detail of the conversation

userId

Yes

Unique id of the receiver user

groupId

Yes

groupId received from group creation API

status

Yes

Status flag of the conversation

Behavior:

  1. Call retrieve conversation API with status flag as NEW, OPEN, DEFAULT.
  2. If no conversation is found, a new conversation will be created.

Status Options:

ValueDescription
NEWThe previous conversation will get ended and new conversation will be created
OPENIf the conversation is closed, it will be re-opened
DEFAULTReturns the conversation as it is

📘

Note:

In case of one-to-one chat, pass userId and in case of group chat, pass groupId in the request body.

Response:
Success Response JSON to the request in case of userId passed

{
  "status": "success",
  "generatedAt": 1473936678880,
  "response": {
    "id": "Group Id (integer)",             // internally creating virtual group
    "clientGroupId": "Group Id (integer)",
    "name": "Group Name",
    "membersId": "[ List of members user names]",
    "removedMembersId": "[]",
    "unreadCount": "(Int) message unread count for the logged in user",
    "type": "Group type",
    "conversationPxy": {
      "id": "(Int)Conversation id",  // pass as "conversationId" in request body for topic based send message
      "topicId": "Topic id of the conversation",
      "topicDetail": "Topic Detail for the conversation",
      "userId": "unique id of the receiver user", // pass as "to" in request body for topic based send message
      "created": "(true/false) if the conversation is created or not in this api",
      "closed": "(true/false) if the conversation is closed",
      "senderUserName": "userId who is initiating topic based chat",
      "status": "status of the conversation",
      "groupId": "(Int) Group id of the virtually created group"
    },
    "createdAtTime": 1473933607470,
    "userCount": 2
  }
}

Response:
Success Response JSON to the request in case of groupId passed

{
  "status": "success",
  "generatedAt": 1473936678880,
  "response": {
    "id": "Group Id (integer)",
    "clientGroupId": "140891",
    "name": "Group Name",
     "adminId": "userId of group admin ",
    "membersId": "[ List of members userIds]",
    "removedMembersId": "[]",
    "unreadCount": "(Int) message unread count for the logged in user",
    "type": "Group type",
    "conversationPxy": {
      "id": "(Int)Conversation id",     // pass as "conversationId" in request body for topic based send message
      "topicId": "Topic id of the conversation",
      "topicDetail": "Topic Detail for the conversation",
      "userId": " userId of User with whom topic based chat initiated",
      "created": "(true/false) if the conversation is created or not in this api",
      "closed": "(true/false) if the conversation is closed",
      "senderUserName": "userId who is initiating topic based chat",
      "status": "status of the conversation",
      "groupId": "(Int) Group id of the respected group"  // pass as "groupId"  in request body for topic based send message
    },
    "imageUrl": "Group image Url",
    "createdAtTime": 1473933607470,
    "userCount": "group user count"
  }
}
Language
Authentication
Click Try It! to start a request and see the response here!