> For the complete documentation index, see [llms.txt](https://dynamicpixels.gitbook.io/dynamicpixels-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dynamicpixels.gitbook.io/dynamicpixels-docs/web-api/friendship.md).

# Friendship

Explore the list of Web APIs functions available for friendship service, including detailed descriptions and usage examples.

{% hint style="warning" %}
To use service functions, first ensure that the service is activated before. You can see services by opening "Service Hub" From the game's dashboard header.&#x20;
{% endhint %}

## GET /api/table/services/friendship/request

> Retrieves a list of friendship requests received by the current user based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship/request":{"get":{"tags":["Friendships"],"summary":"Retrieves a list of friendship requests received by the current user based on the provided parameters.","operationId":"GetMyFriendshipRequests","parameters":[{"name":"skip","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}}}}}}}},"components":{"schemas":{"RichFriendshipRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/RichFriendship"},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"RichFriendship":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"is_ban":{"type":"boolean"},"is_tester":{"type":"boolean"},"is_guest":{"type":"boolean"},"first_login":{"type":"string","format":"date-time","nullable":true},"last_login":{"type":"string","format":"date-time","nullable":true},"status":{"type":"integer","format":"int32"},"accepted_at":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false}}}}
```

## GET /api/table/services/friendship/requesting

> Retrieves a list of friendship requests sent by the current user based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship/requesting":{"get":{"tags":["Friendships"],"summary":"Retrieves a list of friendship requests sent by the current user based on the provided parameters.","operationId":"GetMyFriendshipRequesting","parameters":[{"name":"skip","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}}}}}}}},"components":{"schemas":{"RichFriendshipRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/RichFriendship"},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"RichFriendship":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"is_ban":{"type":"boolean"},"is_tester":{"type":"boolean"},"is_guest":{"type":"boolean"},"first_login":{"type":"string","format":"date-time","nullable":true},"last_login":{"type":"string","format":"date-time","nullable":true},"status":{"type":"integer","format":"int32"},"accepted_at":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/table/services/friendship/request/{requestId}

> Accepts a friendship request based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship/request/{requestId}":{"post":{"tags":["Friendships"],"summary":"Accepts a friendship request based on the provided parameters.","operationId":"AcceptFriendship","parameters":[{"name":"requestId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}}}}}}}},"components":{"schemas":{"RichFriendshipRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/RichFriendship"},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"RichFriendship":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"is_ban":{"type":"boolean"},"is_tester":{"type":"boolean"},"is_guest":{"type":"boolean"},"first_login":{"type":"string","format":"date-time","nullable":true},"last_login":{"type":"string","format":"date-time","nullable":true},"status":{"type":"integer","format":"int32"},"accepted_at":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false}}}}
```

## DELETE /api/table/services/friendship/request/{requestId}

> Rejects a friendship request based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship/request/{requestId}":{"delete":{"tags":["Friendships"],"summary":"Rejects a friendship request based on the provided parameters.","operationId":"RejectFriendship","parameters":[{"name":"requestId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}}}}}}}},"components":{"schemas":{"RichFriendshipRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/RichFriendship"},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"RichFriendship":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"is_ban":{"type":"boolean"},"is_tester":{"type":"boolean"},"is_guest":{"type":"boolean"},"first_login":{"type":"string","format":"date-time","nullable":true},"last_login":{"type":"string","format":"date-time","nullable":true},"status":{"type":"integer","format":"int32"},"accepted_at":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false}}}}
```

## DELETE /api/table/services/friendship/{targetUserId}

> Deletes a friendship with a specified user based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship/{targetUserId}":{"delete":{"tags":["Friendships"],"summary":"Deletes a friendship with a specified user based on the provided parameters.","operationId":"DeleteFriendship","parameters":[{"name":"targetUserId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"boolean"}},"application/json":{"schema":{"type":"boolean"}},"text/json":{"schema":{"type":"boolean"}}}}}}}}}
```

## POST /api/table/services/friendship/request

> Sends a friendship request to another user based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship/request":{"post":{"tags":["Friendships"],"summary":"Sends a friendship request to another user based on the provided parameters.","operationId":"RequestFriendship","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestFriendshipRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/RequestFriendshipRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/RequestFriendshipRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}}}}}}}},"components":{"schemas":{"RequestFriendshipRequest":{"required":["target_user_id"],"type":"object","properties":{"target_user_id":{"type":"integer","format":"int32"}},"additionalProperties":false},"RichFriendshipRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/RichFriendship"},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"RichFriendship":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"is_ban":{"type":"boolean"},"is_tester":{"type":"boolean"},"is_guest":{"type":"boolean"},"first_login":{"type":"string","format":"date-time","nullable":true},"last_login":{"type":"string","format":"date-time","nullable":true},"status":{"type":"integer","format":"int32"},"accepted_at":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false}}}}
```

## DELETE /api/table/services/friendship/request

> Rejects all pending friendship requests based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship/request":{"delete":{"tags":["Friendships"],"summary":"Rejects all pending friendship requests based on the provided parameters.","operationId":"RejectAllFriendship","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ActionResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ActionResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ActionResponse"}}}}}}}},"components":{"schemas":{"ActionResponse":{"type":"object","properties":{"affected":{"type":"integer","format":"int32"}},"additionalProperties":false}}}}
```

## GET /api/table/services/friendship

> Retrieves a list of friendships for the current user based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/friendship":{"get":{"tags":["Friendships"],"summary":"Retrieves a list of friendships for the current user based on the provided parameters.","operationId":"GetMyFriends","parameters":[{"name":"skip","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/RichFriendshipRowsResponse"}}}}}}}},"components":{"schemas":{"RichFriendshipRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/RichFriendship"},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"RichFriendship":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"is_ban":{"type":"boolean"},"is_tester":{"type":"boolean"},"is_guest":{"type":"boolean"},"first_login":{"type":"string","format":"date-time","nullable":true},"last_login":{"type":"string","format":"date-time","nullable":true},"status":{"type":"integer","format":"int32"},"accepted_at":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false}}}}
```
