Skip to content

API endpoints

codemicro edited this page Jan 17, 2020 · 4 revisions

Below are listed the endpoints for the internal API.

Create mod entry

Endpoint - https://www.tdpain.net/nexusapi/create/

Method - POST

Returns - HTTP 201 on success

Parameters:

  • mod_id - required and can be a number with a decimal point
  • mod_name - required.
  • mod_desc
  • mod_version
  • file_id - must be integer if specified in request
  • size_kb - must be integer if specified in request
  • category_name
  • adult_content - must be Boolean if specified in request
  • content_preview - must be valid JSON if specified in request
  • external_virus_scan_url
  • uploaded_time - must be an integer timestamp if specified in request
  • key - required. Internal API authentication key.

Update a mod entry

If the mod ID exists and category_name for that mod is set to one of the following, the row will be updated with the values provided. Otherwise, it will fail.

  • NOT FOUND
  • HIDDEN MOD
  • NO FILES
  • NOT PUBLISHED
  • UNDER MODERATION
  • NON

Endpoint - https://www.tdpain.net/nexusapi/update/

Method - POST

Returns - HTTP 200 on success, HTTP 404 if row not found, HTTP 400 if category_name is invalid

Parameters:

  • mod_id - required and can be a number with a decimal point
  • mod_name
  • mod_desc
  • mod_version
  • file_id - must be integer if specified in request
  • size_kb - must be integer if specified in request
  • category_name
  • adult_content - must be Boolean if specified in request
  • content_preview - must be valid JSON if specified in request
  • external_virus_scan_url
  • uploaded_time - must be an integer timestamp if specified in request
  • key - required. Internal API authentication key.

Retrieve file and mod IDs for mod entry

Endpoint - https://www.tdpain.net/nexusapi/select/

Method - POST

Returns - HTTP 200 on success, HTTP 404 if ID not found

Parameters:

  • mod_id - required and can be a number with a decimal point
  • key - required. Internal API authentication key.

Get next mod to download (set download progress)

Determines the next entry in the mod database where dl_progress and dl_completed are both false, sets its dl_progress to true, and returns the mod and file ID.

Endpoint - https://www.tdpain.net/nexusapi/dl/progress/

Method - POST

Returns - HTTP 200 on success, HTTP 404 if no entries exist that match the criteria defined above

Parameters:

  • key - required. Internal API authentication key

Set the mod's download state (completion)

Sets dl_completed to the Boolean passed in state.

Endpoint - https://www.tdpain.net/nexusapi/dl/complete/

Method - POST

Returns - HTTP 200 on success, HTTP 404 if no entries exist with the specified mod_id

Parameters:

  • key - required. Internal API authentication key.
  • mod_id - required and can be a number with a decimal point
  • state - required. Boolean to indicate the download state. True if completed.

Specifying a parameter as NULL

If a parameter should be NULL, it can be one of the following:

  • not specified in the request
  • "null" in any capitalisation

Specifying a parameter as a Boolean

If a parameter should be a Boolean, it can be one of the following:

  • "1"
  • "0"
  • "true" in any capitalisation
  • "false" in any capitalisation

Clone this wiki locally