cURL
curl --request POST \ --url https://api.example.com/users/@me/relationships/{username} \ --header 'Authorization: <authorization>'
{ "400": {}, "401": {}, "relationship": { "requester": { "id": "<string>", "username": "<string>", "status": 123 }, "requestee": { "id": "<string>", "username": "<string>", "status": 123 }, "status": "<string>" } }
Send a friend request or accept an incoming friend request
Bearer <token>
201 Created
Show SafeRelationship
Show SafeUser
PENDING
ACCEPTED
{ "message": "User with username \"username\" doesn't exist." }
{ "message": "You can't friend yourself. Try making friends :)" }
{ "message": "You are already friends with \"username\"" }
{ "message": "You can't create another outgoing request for \"username\"" }
{ "message": "Unauthorized" }
curl -X POST "http://localhost:8080/users/@me/relationships/alice" \ -H "Authorization: Bearer your-jwt-token"
{ "requester": { "id": "123e4567-e89b-12d3-a456-426614174001", "username": "bob", "status": 1 }, "requestee": { "id": "123e4567-e89b-12d3-a456-426614174000", "username": "alice", "status": 2 }, "status": "PENDING" }
{ "requester": { "id": "123e4567-e89b-12d3-a456-426614174000", "username": "alice", "status": 2 }, "requestee": { "id": "123e4567-e89b-12d3-a456-426614174001", "username": "bob", "status": 1 }, "status": "ACCEPTED" }