Upload To Gofile
POST /v1/api/integration/gofile
POST https://api.torbox.app/v1/api/integration/gofile
- Operation ID:
upload_to_gofile - Group: Integrations
- Auth: API key,
Authorization: Bearer <api key>(Sign in with TorBox gives the same key)
Overview
Uploads a file, or a zip of a whole download, from your TorBox account to Gofile. Send the id of the torrent, usenet download or web download, its type, and either the file_id of one file or zip set to true. gofile_token is optional: with it the upload is made with that Gofile account's API token, without it the upload is sent without a Gofile login.
The route answers at once with a job_id. The upload itself runs in the background as a transfer job, and nothing is checked with Gofile before the answer, so a token Gofile does not accept only shows up as a failed job. Follow the job with Get Specific Job (/v1/api/integration/job/{job_id}), Get All Jobs (/v1/api/integration/jobs) or Get All Jobs By Hash (/v1/api/integration/jobs/{hash}), and stop it with Cancel Specific Job.
The job goes from "pending" through "preparing" and "uploading" to "completed" or "failed". Its detail says what it is doing or why it failed, and its progress runs from 0 to 1. When it is completed, its download_url is the Gofile download page of the file and you get an "Upload Complete" notification. A failed job is deleted about an hour after it failed, a completed job about 7 days after it completed.
The download has to be cached on TorBox, otherwise the job fails. If you send neither file_id nor zip, the request is still queued, but there is no file to upload and the job fails. If your settings have a gofile_folder_id, the file is put in that folder, but only when a gofile_token is sent.
Authorization
Requires an API key using the Authorization Bearer Header.
Request body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | yes | Id of the torrent, usenet download or web download to upload. It has to be one of your own downloads. Required. |
file_id | integer | no | Id of the file to upload, from the download's files. Leave out when zip is true. |
zip | boolean | no | Upload the whole download as one zip instead of a single file. Takes precedence over file_id. Optional, default false. |
type | string | no | Which kind of download id refers to. One of torrent, usenet or webdownload. Optional, default torrent. |
gofile_token | string | no | Gofile API token of the account to upload to. It is issued by Gofile, not by TorBox. Optional. |
Responses
200Successful Response400Bad Request401Unauthorized403Forbidden404Not Found422Validation Error429Too Many Requests500Internal Server Error503Service Unavailable