### Paginate API Responses (GET Request Example) Source: https://docs.bunny.net/reference/bunnynet-api-overview/index This example shows how to use the 'page' and 'perPage' query parameters to paginate through API results. This is useful for managing large datasets efficiently. The response includes current page information and total item counts. ```http GET https://api.bunny.net/dnszone?page=1&perPage=10 ``` -------------------------------- ### Example API Error Response Source: https://docs.bunny.net/reference/bunnynet-api-overview/index This example illustrates the structure of a typical error response from the bunny.net API. It includes an 'ErrorKey', 'Field', and 'Message' to help diagnose and resolve issues with your requests. ```json { "ErrorKey": "pullZone.not_found", "Field": "PullZone", "Message": "The requested Pull Zone was not found" } ``` -------------------------------- ### Authenticate API Requests with AccessKey (cURL) Source: https://docs.bunny.net/reference/bunnynet-api-overview/index This example demonstrates how to authenticate API requests by including your account AccessKey in the request header. The AccessKey is required for all account-specific actions. Ensure your API key is kept secure. ```curl curl --request GET \ --url https://api.bunny.net/dnszone \ --header 'AccessKey: 4ef48caf-3b9a-492a-6ffe-9961ead7522d2ac3f9b5-1d1c-5511-80ca-29788315287b' ``` -------------------------------- ### Data Format Source: https://docs.bunny.net/reference/bunnynet-api-overview/index The bunny.net API uses JSON for requests and responses. GET requests use query parameters, while other methods use a JSON request body. ```APIDOC ## Data Format ### Description The bunny.net API uses JSON as the standard format for both requests and responses. ### Request Data Format - For **GET** requests, parameters should be sent as query strings. - For **POST**, **PUT**, and other methods that require a body, the request body must be in JSON format. ### Response Data Format Responses from the API are always in JSON format. ### Content Type No explicit `Content-Type` header is required for JSON requests; the API assumes JSON by default. ``` -------------------------------- ### Pagination Source: https://docs.bunny.net/reference/bunnynet-api-overview/index Manage large datasets efficiently using the `page` and `perPage` query parameters for paginated requests. ```APIDOC ## Pagination ### Description To handle large amounts of data, the API supports pagination through `page` and `perPage` query parameters. ### Query Parameters - **page** (integer) - The page number to retrieve (e.g., 1, 2, 3). - **perPage** (integer) - The number of items to return per page (e.g., 10, 20, 50). ### Request Example ``` GET https://api.bunny.net/dnszone?page=1&perPage=10 ``` ### Response Fields - **Items** (array) - A list of items for the current page. - **CurrentPage** (integer) - The current page number. - **TotalItems** (integer) - The total number of items available across all pages. - **HasMoreItems** (boolean) - Indicates if there are more pages of results. ### Response Example ```json { "Items": [], "CurrentPage": 1, "TotalItems": 2, "HasMoreItems": false } ``` ``` -------------------------------- ### API Authentication Source: https://docs.bunny.net/reference/bunnynet-api-overview/index To authenticate your API requests, include your account's AccessKey in the request header. ```APIDOC ## API Authentication ### Description Requests to the bunny.net API must be authenticated. This is done by including your account's API key in the `AccessKey` header. ### Method All HTTP Methods ### Header - **AccessKey** (string) - Required - Your account API key. ### Request Example ```bash curl --request GET \ --url https://api.bunny.net/dnszone \ --header 'AccessKey: YOUR_API_KEY' ``` ### Notes - You can find your API key in your account settings. - Ensure your API key is kept secure and not exposed publicly. ``` -------------------------------- ### Error Handling Source: https://docs.bunny.net/reference/bunnynet-api-overview/index Understand the standard HTTP status codes and error response format to handle API errors effectively. ```APIDOC ## Error Handling ### Description The API returns standard HTTP status codes and a JSON error body to indicate issues with a request. ### Common Status Codes - **400 Bad Request**: The request failed validation (e.g., invalid model, body, or parameters). - **401 Unauthorized**: Authentication failed. Your API key may be invalid or missing. - **403 Forbidden**: The action is not permitted for your account or due to resource restrictions. - **404 Not Found**: The requested resource could not be found. - **429 Too Many Requests**: You have exceeded the API rate limit. - **500 Internal Server Error**: An unexpected error occurred on the server. ### Error Response Body ```json { "ErrorKey": "string", "Field": "string", "Message": "string" } ``` - **ErrorKey** (string): A specific key identifying the type of error. - **Field** (string): The field related to the error, if applicable. - **Message** (string): A human-readable description of the error. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.