### Curl Request Example for Discord Place API Source: https://docs.discord.place/index This snippet demonstrates how to make a request to the Discord Place API using Curl. It includes common headers like Accept and Content-Type, and shows how to include a JSON body. This is useful for interacting with the API from the command line or in scripts. ```Curl curl 'https://example.com/api/endpoint' \ -H 'Accept: */*' \ -H 'Content-Type: application/json' \ --data-raw '{ "command_count": 100, "server_count": 1500 }' ``` -------------------------------- ### Discord Place API Interaction Source: https://docs.discord.place/index This snippet details how to interact with the Discord Place API, including setting headers, cookies, and query parameters, and sending a JSON body. ```APIDOC ## POST /websites/discord_place ### Description This endpoint allows for interaction with the Discord Place API. It supports custom headers, cookies, query parameters, and a JSON request body. ### Method POST ### Endpoint /websites/discord_place ### Parameters #### Path Parameters None #### Query Parameters - **Key** (string) - Optional - Description for Key - **Value** (string) - Optional - Description for Value #### Request Body - **command_count** (integer) - Required - The number of commands. - **server_count** (integer) - Required - The number of servers. ### Request Example ```json { "command_count": 100, "server_count": 1500 } ``` ### Headers - **Accept** (string) - */* - **Content-Type** (string) - application/json - **Key** (string) - Optional - Custom header key - **Value** (string) - Optional - Custom header value ### Cookies - **Key** (string) - Optional - Custom cookie key - **Value** (string) - Optional - Custom cookie value ### Response #### Success Response (200) - **status** (string) - Indicates the success status of the operation. - **message** (string) - A descriptive message about the operation. #### Response Example ```json { "status": "success", "message": "Operation completed successfully." } ``` ``` -------------------------------- ### Successful Operation Response (JSON) Source: https://docs.discord.place/index A sample JSON response indicating a successful API operation, typically used for operations like updating bot statistics. ```json { "success": true } ``` -------------------------------- ### Update Bot Statistics Source: https://docs.discord.place/index Updates a bot's command count and/or server count. Requires a valid bot ID and authentication. ```APIDOC ## PATCH /bots/{id}/stats ### Description Updates a bot's command count and/or server count. This endpoint requires a valid bot ID and authentication. ### Method PATCH ### Endpoint `/bots/{id}/stats` ### Parameters #### Path Parameters - **id** (Snowflake) - Required - The Snowflake ID of the bot. #### Request Body - **command_count** (integer) - Optional - The number of commands the bot has (min: 0, max: 1000). - **server_count** (integer) - Optional - The number of servers the bot is in (min: 0, max: 10000000). Note: This value can only differ by at most 50 from your bot's actual server count. ### Request Example ```curl curl https://api.discord.place/bots/123456789012345678/stats \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: YOUR_SECRET_TOKEN' \ --data '{ "command_count": 100, "server_count": 1500 }' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Update Bot Statistics (Shell) Source: https://docs.discord.place/index Updates a bot's command count and server count using a PATCH request. Requires bot ID and a JSON body with 'command_count' and 'server_count'. Returns a 200 status on success. ```shell curl https://api.discord.place/bots/123456789012345678/stats \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: YOUR_SECRET_TOKEN' \ --data '{ "command_count": 100, "server_count": 1500 }' ``` -------------------------------- ### Vote Webhook Source: https://docs.discord.place/index A webhook sent when a user votes for a bot or server. Supports retries on failure. ```APIDOC ## POST /webhooks/vote ### Description Webhook sent when a user votes for a bot or server. The API will retry delivery up to 3 times with a 5-second delay if the response status code is not between 200-299. ### Method POST ### Endpoint `/webhooks/vote` ### Parameters #### Request Body - **test** (boolean) - Required - True if this is a test webhook. - **user** (string) - Required - User ID of the voter. - **bot** (string) - Optional - Bot ID (present for bot webhooks). - **guild** (string) - Optional - Guild ID (present for server webhooks). ### Request Example ```json { "bot": "123456789012345678", "user": "987654321098765432", "test": false } ``` ``` -------------------------------- ### Successful Vote Check Response (JSON) Source: https://docs.discord.place/index A sample JSON response for checking a user's vote status, indicating if the user voted, the vote count, and the timestamp of the last vote. ```json { "voted": true, "vote": 1, "lastVote": 1694345400000 } ``` -------------------------------- ### Vote Webhook Payload (JSON) Source: https://docs.discord.place/index Represents the JSON payload for a vote webhook, indicating whether it's a test, the user ID, and optionally the bot or guild ID. ```json { "bot": "123456789012345678", "user": "987654321098765432", "test": false } ``` -------------------------------- ### Check User Vote Status (Shell) Source: https://docs.discord.place/index Checks if a user has voted for a specific bot in the last 24 hours. Requires bot ID and user ID. Returns vote status, vote count, and last vote timestamp. ```shell curl https://api.discord.place/bots/123456789012345678/voters/123456789012345678 \ --header 'Authorization: YOUR_SECRET_TOKEN' ``` -------------------------------- ### Check User Vote Status Source: https://docs.discord.place/index Retrieves whether a user has voted for a specific bot in the last 24 hours, along with vote details. Requires bot ID, user ID, and authentication. ```APIDOC ## GET /bots/{id}/voters/{user_id} ### Description Retrieves whether a user has voted for the specified bot in the last 24 hours along with vote details. Requires bot ID, user ID, and authentication. ### Method GET ### Endpoint `/bots/{id}/voters/{user_id}` ### Parameters #### Path Parameters - **id** (Snowflake) - Required - The Snowflake ID of the bot. - **user_id** (Snowflake) - Required - The ID of the user to check. ### Request Example ```curl curl https://api.discord.place/bots/123456789012345678/voters/123456789012345678 \ --header 'Authorization: YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) - **voted** (boolean) - Indicates if the user has voted. - **vote** (integer) - Vote count. - **lastVote** (integer) - Timestamp of the last vote. #### Response Example ```json { "voted": true, "vote": 1, "lastVote": 1694345400000 } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.