cURL
curl --request POST \ --url https://{appid}.api-{region}.cometchat.io/v3/users/{uid}/friends \ --header 'Content-Type: application/json' \ --header 'apikey: <api-key>' \ --data ' { "accepted": [ "<string>" ], "addToConversations": false } '
{ "data": { "accepted": { "superhero2": { "success": true, "message": "Created relationship with status accepted." }, "superhero3": { "success": true, "message": "Created relationship with status accepted." } } } }
The API allows to add multiple friends for a given UID.
API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
An UID of a user.
The array of UIDs of the friends.
When enabled, automatically creates chat conversations between users when they become friends.
Added Friend
Show child attributes
Was this page helpful?