پرش به مطلب اصلی

Files API

POST /files

Description

This API endpoint retrieves a list of all files.

Request Body

The request uses GraphQL to perform the files query, which does not require any parameters.

Query:

query files {
files {
id
title
description
url
}
}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query files {\n files {\n id\n title\n description\n url\n }\n}","variables":{}}'

Response:

  • Success (200 OK):

    • The response includes a list of all files with their details.
    {
    "data": {
    "files": [
    {
    "id": 1,
    "title": "User Guide",
    "description": "Comprehensive guide for users.",
    "url": "https://example.com/files/user-guide.pdf"
    },
    {
    "id": 2,
    "title": "API Documentation",
    "description": "Detailed API documentation.",
    "url": "https://example.com/files/api-docs.pdf"
    }
    ]
    }
    }
    • id: Unique identifier for the file.
    • title: Title of the file.
    • description: Description of the file.
    • url: URL to access or download the file.
  • Error (4XX/5XX):

    • If there is a server error, the response will include an error message and status code.

Note:

This endpoint provides a comprehensive list of all available files with their details, including the URL where they can be accessed or downloaded.