Skip to content

Sends a buddy request to a user.

PUT
/api/buddy/{userId}

Authorizations

api_key
Type: API Key (header: X-CSRF-Token)

Parameters

Path Parameters

userId*

which user to send the request to

Typeinteger
Required

Responses

Success.
JSON
{
"isBuddy": true
}
Authorization
api_key
Variables
Key
Value
userId*
cURL
curl -X PUT \
'http://localhost/api/buddy/{userId}'

Samples

cURL
curl -X PUT http://localhost/api/buddy/{userId}
JavaScript
fetch("http://localhost/api/buddy/{userId}", { method: "PUT" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/api/buddy/{userId}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.put("http://localhost/api/buddy/{userId}")
print(response.json())