1
0
This repository has been archived on 2024-02-27. You can view files and clone it, but cannot push or open issues or pull requests.
chatgpt-to-api/docs/admin.md
Antonio Cheong 979405d34d
format
2023-04-12 19:01:08 +08:00

1.4 KiB

API Documentation:

puidHandler:

This API endpoint receives a POST request with a JSON body that contains a "puid" field. The API updates the value of the PUID variable with the value provided in the request body.

HTTP method: POST

Endpoint: /puid

Request body:

{
    "puid": string
}

Response status codes:

  • 200 OK: The PUID variable was successfully updated.
  • 400 Bad Request: The "puid" field is missing or not provided in the request body.

passwordHandler:

This API endpoint receives a POST request with a JSON body that contains a "password" field. The API updates the value of the ADMIN_PASSWORD variable with the value provided in the request body.

HTTP method: POST

Endpoint: /password

Request body:

{
    "password": string
}

Response status codes:

  • 200 OK: The ADMIN_PASSWORD variable was successfully updated.
  • 400 Bad Request: The "password" field is missing or not provided in the request body.

tokensHandler:

This API endpoint receives a POST request with a JSON body that contains an array of request tokens. The API updates the value of the ACCESS_TOKENS variable with a new access token generated from the request tokens provided in the request body.

HTTP method: POST

Endpoint: /tokens

Request body:

[
    string
]

Response status codes:

  • 200 OK: The ACCESS_TOKENS variable was successfully updated.
  • 400 Bad Request: The request tokens are missing or not provided in the request body.