Once two users are friends (i.e. they have accepted each other as friends), then you can associate them as friends in CometChat.
Available operations
| Method | Endpoint | Description |
|---|---|---|
| POST | /users/{uid}/friends | Add friends for a user |
| GET | /users/{uid}/friends | List all friends of a user |
| DELETE | /users/{uid}/friends | Remove friends from a user |
Friend properties
The following table lists the properties that the Friends API supports| Parameters | Type | Description |
|---|---|---|
| accepted | array of strings | (optional) Indicates an array of UIDs that are to be made friends. Maximum of 25 users can be passed in the accepted array. |
Error handling
| Error Code | Description |
|---|---|
AUTH_ERR_EMPTY_APIKEY | API key is missing from the request headers |
AUTH_ERR_APIKEY_NOT_FOUND | The provided API key is invalid |
ERR_UID_NOT_FOUND | The specified user UID does not exist |