Skip to main content

Check if a user is a participant

Check whether a specific user is currently in a specific open channel.

tip

Results may be affected by the offline participant auto-exit mechanism. Offline users may be automatically removed under certain conditions.

Request

POST: https://[Base URL](/platform-chat-api/base-url)/v4/open-channel/participant/exist

Rate limit: 100 per second

Signature: Required. See API request signature.

Request body

Content type: application/json

ParameterTypeRequiredDescription
channelIdStringYesThe open channel ID.
participantIdsString[]YesThe user ID(s) to check. Pass a single-element array to check one user.

Request example

HTTP
POST /v4/open-channel/participant/exist HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Timestamp: 1408710653491
Nonce: 14314
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json

{
"channelId": "10001",
"participantIds": ["5"]
}

Response

FieldTypeDescription
codeNumberReturn code. 0 indicates success.
resultObjectResult data.
result.participantsObject[]Array of results.
result.participants[i].participantIdStringUser ID.
result.participants[i].isInOpenChannelNumberWhether the user is in the open channel. 1 = yes, 0 = no.

Response example

HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"code": 0,
"result": {
"participants": [
{
"participantId": "5",
"isInOpenChannel": 1
}
]
}
}