Difference between revisions of "Make and Remove Admin"
Ashley DeBon (talk | contribs) (→Make Or Remove Group Admin) |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| Line 39: | Line 39: | ||
| user_id || integer || Yes || Unique identifier of the group member whose admin status should be toggled (must not be the authenticated user) | | user_id || integer || Yes || Unique identifier of the group member whose admin status should be toggled (must not be the authenticated user) | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/group-admin-settings' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "group_id": YOUR_GROUP_ID, "user_id": YOUR_TARGET_USER_ID }' </pre> | ||
| + | |||
| + | === cURL Example for iOS === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/group-admin-settings' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "group_id": YOUR_GROUP_ID, "user_id": YOUR_TARGET_USER_ID }' </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 13:42, 21 July 2026
Mobile_API »Make Or Remove Group Admin
Base URL
https://apimobile.callproof.com
Endpoint
/api/group-admin-settings
Purpose
Toggles a user’s group-admin status in a video message group. The authenticated user must already be a group admin and must belong to the group. The target user cannot be the authenticated user. If the target user is currently an admin, admin status is removed; otherwise admin status is granted.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| group_id | integer | Yes | Unique identifier of the video message group (room) |
| user_id | integer | Yes | Unique identifier of the group member whose admin status should be toggled (must not be the authenticated user) |
cURL Example for Android
curl --location 'https://apimobile.callproof.com/api/group-admin-settings' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "group_id": YOUR_GROUP_ID, "user_id": YOUR_TARGET_USER_ID }'
cURL Example for iOS
curl --location 'https://apimobile.callproof.com/api/group-admin-settings' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "group_id": YOUR_GROUP_ID, "user_id": YOUR_TARGET_USER_ID }'
Successful Response (200)
Indicates that the group admin status was updated successfully.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| message | string | Confirmation message (for example, "Admin details updated successfully") |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation/authorization check failed – response body uses clientStatusCode 401 with an error message
|
| 400 | Bad Request – admin status could not be updated |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation / permission (HTTP 200, clientStatusCode 401) – Missing
group_idoruser_id; target user is the authenticated user ("Provided user matched with login users! please try some other users"); authenticated user is not a group admin ("Login user as not an group admin of this group"); or authenticated user does not belong to the group ("Provided User does not belongs to this group"). - 400 – An error occurred while updating admin status (for example, "Error while making the user as group admin").
- 401 – Authentication failed or the access token is missing/expired.