# API Documentation - StockPanel

Authentication

Each request must include an Authorization header with the Bearer token. Example:

                        
        GET /api/profile HTTP/1.1
        Host: stockpanel.la
        Authorization: Bearer YOUR_API_ACCESS_TOKEN
                        
                    

GET /api/profile

Returns the profile of the authenticated user.

Response

            {
                "status": "success",
                "message": "Your request is successful.",
                "data": {
                    "profile": {
                        "id": 1,
                        "name": "John Doe",
                        "email": "[email protected]",
                        "email_verified_at": "2023-06-01T00:00:00.000000Z",
                        "is_banned": false,
                        "created_at": "2023-01-01T00:00:00.000000Z",
                        "updated_at": "2023-06-01T00:00:00.000000Z"
                    }
                }
            }

GET /api/credits

Returns the credits balance of the authenticated user.

Response

            {
                "status": "success",
                "message": "Your request is successful.",
                "data": {
                    "credits": 100
                }
            }

GET /api/providers

Returns a list of supported providers.

Response

            {
                "status": "success",
                "message": "Your request is successful.",
                "data": {
                  "providers": [
                    {
                      "id": 1,
                      "name": "123rf Pre",
                      "slug": "123rf",
                      "host": "123rf.com",
                      "type": "123rf_standard",
                      "resolution": "High",
                      "license": "Standard",
                      "price": 5,
                      "is_premium": true,
                      "is_active": true,
                      "created_at": "2024-07-10T19:44:57.000000Z",
                      "updated_at": "2024-07-10T19:44:57.000000Z"
                    },
                    {
                      "id": 2,
                      "name": "Adobestock",
                      "slug": "adobestock",
                      "host": "stock.adobe.com",
                      "type": "adobestock_standard",
                      "resolution": "High",
                      "license": "Standard",
                      "price": 3,
                      "is_premium": true,
                      "is_active": true,
                      "created_at": "2024-07-10T19:44:57.000000Z",
                      "updated_at": "2024-07-10T19:44:57.000000Z"
                    },
                    ...
                }
            }

GET /api/queue-download

Queues a file for download.

Request Parameters

  • file_url (required): The URL of the file to download.

Response for fresh and non active download link

            {
                "status": "success",
                "message": "File is queued successfully for downloading.",
                "data": {
                    "download_id": "9c830079-f7b4-49d5-bd1f-1006c32b4390"
                }
            }

Response for duplicate & non expired download link

            {
                "status": "success",
                "message": "You already have this file active in your downloads and hence no credits utilised.",
                "data": {
                  "download_id": "9c830079-f7b4-49d5-bd1f-1006c32b4390"
                }
              }

Errors

            {
                "status": "failed",
                "message": "The file_url parameter is required and must be a valid, active URL!"
            }

GET /api/download-info

Returns information about a queued download.

Request Parameters

  • id (required): The UUID of the download.

Response

            {
                "status": "success",
                "message": "Your request is successful.",
                "data": {
                  "link_meta": {
                    "url": "https://elements.envato.com/documentary-storytelling-cinematic-X437BHG?v=3",
                    "provider_slug": "elementenvato",
                    "item_type": "elementenvato_standard",
                    "item_id": "X437BHG",
                    "item_slug": "documentary-storytelling-cinematic",
                    "item_name": "Documentary Storytelling Cinematic",
                    "item_ext": "zip"
                  },
                  "download_meta": {
                    "status": {
                      "code": 4, // total 0, 1, 2, 3, 4 status codes
                      "message": "Download completed" // this varries based on status code
                    },
                    "file_meta": { // file_meta is null for 0 and 1 status codes
                      "name": "elementenvato_standard_X437BHG.zip",
                      "size": "22.07 MB",
                      "server": "stockpanel" // or "direct"
                    }
                  }
                }
              }

Errors

            {
                "status": "failed",
                "message": "The id parameter is required and must be an existing download ID!"
            }

GET /api/download-file

Provides a link to download the file.

Request Parameters

  • id (required): The UUID of the download.

Response

            {
                "status": "success",
                "message": "Your request is successful.",
                "download_link": "https://stockpanel-site.s3.ap-south-1.amazonaws.com/downloads/1720873388669271aca8906.zip?response-content-type=application%2Foctet-stream&response-content-disposition=attachment%3B%20filename%3Delementenvato_standard_X437BHG.zip&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAU6GD2HA7Y73ERKLP%2F20240713%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20240713T122411Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Signature=74544c383aad3c3dbc9122965e3fdcd4b72d655ec43e337b01835818a0847017"
              }

Errors

            {
                "status": "failed",
                "message": "This download ID has been expired! Please create a new download request."
            }