🖼️Upload Image
Image Upload API Documentation
Overview
The Pics Shade API allows users to upload images using an API key. This guide provides detailed instructions on how to use the API with JavaScript, including code examples and sample outputs.
Endpoint
URL: https://pics.shade.cool/api/upload
Method: POST
Authentication
To use the API, you need an API key. You can obtain your API key from the Pics Shade Dashboard.
Request Headers
Authorization: Bearer <your_api_key>
Content-Type: multipart/form-data
Request Body
The request body should be a FormData
object containing the following fields:
file
: The image file to be uploaded.path
: The path where the image should be stored (e.g.,folder1/folder2
).tags
: A comma-separated list of tags associated with the image (optional).
Sample JavaScript Code
Here's a sample JavaScript code snippet for uploading an image using the Fetch API:
Sample Output
Successful Response:
Error Response:
Error Handling
Ensure you handle errors appropriately in your code. Common errors include:
Invalid API key
File upload errors
Network issues
Notes
The
file
field is required. Ensure you are uploading a valid image file.The
path
field is required. This specifies where the image will be stored.The
tags
field is optional but recommended for easier image management.
For more details, visit the Pics Shade API Documentation.
This guide provides a comprehensive overview of how to use the Pics Shade API for image uploads, including necessary headers, request body format, and sample JavaScript code for integration.
Last updated