API documentation
💻

API documentation

Welcome to the API documentation for ToplistBot's backend. This document provides an overview of available endpoints along with their functionalities and usage.

Base URL

All endpoints are prefixed with the base URL:
https://backend.toplistbot.com

Products

Retrieve Token Products

  • URL: /products/tokens
  • Method: GET
  • Description: Retrieves products with available tokens.
  • Response: Returns a list of products with available tokens and no assigned user.

Get Suggestions

  • URL: /products/getSuggestions
  • Method: POST
  • Description: Retrieves suggestions based on provided site IDs.
  • Request Body:
    • siteIds (required): Array of site IDs for which suggestions are requested.
    • limit (optional): Limit the number of suggestions to be returned. Default is 8.
  • Response: Returns a list of suggested websites based on provided site IDs and optional limit.

Sample Usage

Retrieve Token Products
GET /products/tokens
Get Suggestions
POST /products/getSuggestions { "siteIds": [1, 2, 3], "limit": 10 }

Orders

Get All Orders

  • URL: /orders/getAll
  • Method: GET
  • Description: Retrieves all orders for the authenticated user.
  • Authentication: Requires API authentication.
  • Response: Returns a list of orders associated with the authenticated user.

Get Order by ID

  • URL: /orders/get/{id}
  • Method: GET
  • Description: Retrieves the order with the specified ID for the authenticated user.
  • Authentication: Requires API authentication.
  • Request Parameters:
    • id (required): ID of the order to retrieve.
  • Response: Returns the order with the specified ID if found, otherwise returns an error message.

Sample Usage

Get All Orders
GET /orders/getAll
Get Order by ID
GET /orders/get/{id}

Advanced

Create Profile

  • URL: /advanced/profile/create
  • Method: POST
  • Description: Creates a new profile with the provided usernames.
  • Authentication: Requires API authentication.
  • Request Body:
    • usernames (required): Array of usernames for the profile.
    • name (required): Name of the profile.
  • Response: Returns a message indicating success or failure along with details of the created profile.

Delete Profile

  • URL: /advanced/profile/delete/{id}
  • Method: DELETE
  • Description: Deletes the profile with the specified ID.
  • Authentication: Requires API authentication.
  • Request Parameters:
    • id (required): ID of the profile to delete.
  • Response: Returns a message indicating success or failure of the deletion operation.

Get Profile

  • URL: /advanced/profile/get
  • Method: GET
  • Description: Retrieves all profiles associated with the authenticated user.
  • Authentication: Requires API authentication.
  • Response: Returns a list of profiles associated with the authenticated user.

Get Profile by ID

  • URL: /advanced/profile/get/{id}
  • Method: GET
  • Description: Retrieves the profile with the specified ID for the authenticated user.
  • Authentication: Requires API authentication.
  • Request Parameters:
    • id (required): ID of the profile to retrieve.
  • Response: Returns the profile with the specified ID if found, otherwise returns an error message.

Sample Usage:

Create Profile
POST /advanced/profile/create { "usernames": ["username1", "username2"], "name": "Profile Name" }
Delete Profile
DELETE /advanced/profile/delete/{id}
Get Profile
GET /advanced/profile/get
Get Profile by ID
GET /advanced/profile/get/{id}

Proxy Profiles

Load Proxy Profiles

  • URL: /profile/proxy/get
  • Method: GET
  • Description: Retrieves all proxy profiles associated with the authenticated user.
  • Authentication: Requires API authentication.
  • Response: Returns a list of proxy profiles associated with the authenticated user.

Create Proxy Profile

  • URL: /profile/proxy/create
  • Method: POST
  • Description: Creates a new proxy profile with the provided name and country list.
  • Authentication: Requires API authentication.
  • Request Body:
    • name (required): Name of the proxy profile.
    • country_list (required): Array of countries for the proxy profile.
  • Response: Returns a message indicating success or failure along with details of the created proxy profile.

Delete Proxy Profile

  • URL: /profile/proxy/delete/{id}
  • Method: DELETE
  • Description: Deletes the proxy profile with the specified ID.
  • Authentication: Requires API authentication.
  • Request Parameters:
    • id (required): ID of the proxy profile to delete.
  • Response: Returns a message indicating success or failure of the deletion operation.

Get Proxy Profile by ID

  • URL: /profile/proxy/get/{id}
  • Method: GET
  • Description: Retrieves the proxy profile with the specified ID for the authenticated user.
  • Authentication: Requires API authentication.
  • Request Parameters:
    • id (required): ID of the proxy profile to retrieve.
  • Response: Returns the proxy profile with the specified ID if found, otherwise returns an error message.

Sample Usage

Load Proxy Profiles
GET /profile/proxy/get
Create Proxy Profile
POST /profile/proxy/create { "name": "My Proxy Profile", "country_list": ["USA", "UK", "Canada"] }
Delete Proxy Profile
DELETE /profile/proxy/delete/{id}
Get Proxy Profile by ID
GET /profile/proxy/get/{id}

Orders

Get All Websites

  • URL: /orders/getAllWebsites
  • Method: GET
  • Description: Retrieves all websites including basic details.
  • Authentication: No authentication required.
  • Response: Returns a list of websites including their basic details.

Get All Basic Websites Details

  • URL: /orders/getAllBasicWebsitesDetails
  • Method: GET
  • Description: Retrieves basic details of approximately 20 random websites.
  • Authentication: No authentication required.
  • Response: Returns a list of basic details of approximately 20 random websites.

Get Website Details by Name

  • URL: /orders/getWebsiteDetailsByName
  • Method: POST
  • Description: Retrieves details of a website by its name.
  • Authentication: No authentication required.
  • Request Body:
    • name (required): Name of the website.
  • Response: Returns details of the website with the specified name.

Sample Usage

Get All Websites
GET /orders/getAllWebsites
Get All Basic Websites Details
GET /orders/getAllBasicWebsitesDetails
Get Website Details by Name
POST /orders/getWebsiteDetailsByName { "name": "Example Website Name" }

Place Order

  • URL: /orders/checkout
  • Method: POST
  • Description: Places a new order.
  • Authentication: Requires API authentication.
  • Request Body: Provide order details.
  • Response: Returns a success message if the order is successfully placed.

Edit Order

  • URL: /orders/update
  • Method: POST
  • Description: Updates an existing order.
  • Authentication: Requires API authentication.
  • Request Body: Provide order details to be updated.
  • Response: Returns a success message if the order is successfully updated.

Pause Order

  • URL: /orders/pause
  • Method: POST
  • Description: Pauses an existing order.
  • Authentication: Requires API authentication.
  • Request Body: Provide the ID of the order to be paused.
  • Response: Returns a success message if the order is successfully paused.

Unpause Order

  • URL: /orders/unpause
  • Method: POST
  • Description: Unpauses a paused order.
  • Authentication: Requires API authentication.
  • Request Body: Provide the ID of the order to be unpaused.
  • Response: Returns a success message if the order is successfully unpaused.

Archive Order

  • URL: /orders/archive
  • Method: POST
  • Description: Archives an existing order.
  • Authentication: Requires API authentication.
  • Request Body: Provide the ID of the order to be archived.
  • Response: Returns a success message if the order is successfully archived.

Unarchive Order

  • URL: /orders/unarchive
  • Method: POST
  • Description: Unarchives an archived order.
  • Authentication: Requires API authentication.
  • Request Body: Provide the ID of the order to be unarchived.
  • Response: Returns a success message if the order is successfully unarchived.

Sample Usage

Place Order
POST /orders/checkout { // Order details }
Edit Order
POST /orders/update { // Updated order details }
Pause Order
POST /orders/pause { "id": "order_id" }
Unpause Order
POST /orders/unpause { "id": "order_id" }
Archive Order
POST /orders/archive { "id": "order_id" }
Unarchive Order
POST /orders/unarchive { "id": "order_id" }

Orders Logs

Get Logs by ID

  • URL: /orders/logs/{id}
  • Method: GET
  • Description: Retrieves logs for the specified order ID.
  • Authentication: Requires API authentication.
  • Request Parameters: id (required) - ID of the order to retrieve logs for.
  • Response: Returns logs related to the specified order.

Get Logs for Graph

  • URL: /orders/graph/{id}
  • Method: GET
  • Description: Retrieves logs for graph visualization for the specified order ID.
  • Authentication: Requires API authentication.
  • Request Parameters: id (required) - ID of the order to retrieve logs for.
  • Response: Returns logs suitable for graph visualization.

Get Grouped Logs by Usernames

  • URL: /orders/grouped/usernames/{id}
  • Method: GET
  • Description: Retrieves grouped logs by usernames for the specified order ID.
  • Authentication: Requires API authentication.
  • Request Parameters: id (required) - ID of the order to retrieve logs for.
  • Response: Returns logs grouped by usernames.

Get Average for Order by Array

  • URL: /orders/average
  • Method: POST
  • Description: Retrieves the average for the specified orders by array of IDs.
  • Authentication: Requires API authentication.
  • Request Body: Provide an array of order IDs.
  • Response: Returns the average for each order in the array.

Sample Usage

Get Logs by ID
GET /orders/logs/{id}
Get Logs for Graph
GET /orders/graph/{id}
Get Grouped Logs by Usernames
GET /orders/grouped/usernames/{id}
Get Average for Order by Array
POST /orders/average { "ids": "1,2,3,4,5" }
Â