Skip to main content

Get Channel Member

The getChannelMember method in the YoPhone Bot API is used to retrieve information about a specific user’s membership status in a channel where the bot is an administrator.

Request Format

You need to send a POST request to:

https://yoai.yophone.com/api/pub/getChannelMember

Request example

curl -X POST https://yoai.yophone.com/api/pub/getChannelMember \
-H "Content-Type: application/json" \
-H "X-YoAI-API-Key: your YoAI api key" \
-d '{
"channelId": "channelId",
"userId": "usersId"
}'

Explanation:

  • Replace api key with your actual bot token.
  • Replace channelId with your channel's ID.
  • Replace usersId with the actual YoPhone user ID you want to check.

Success Response

The API returns a JSON object indicating the success of the operation.

{
"code": 200,
"success": true,
"data": {
"user": {
"userId": "",
"isBot": false,
"firstName":"",
"lastName":"",
"username": ""
},
"status": "member"
}
}

Failure Response

The API returns a JSON object indicating the success of the operation.

{
"code": 200,
"success": false,
"message": "not found"
}