Skip to content

Latest commit

 

History

History
333 lines (235 loc) · 17.6 KB

integrations_service.md

File metadata and controls

333 lines (235 loc) · 17.6 KB

IntegrationsService

A list of all methods in the IntegrationsService service. Click on the method name to view detailed information about that method.

Methods Description
AuthenticateOauth ### Overview Allows you to get an authorization token for using the user's account. Callback is located at /oauth/{provider}/callback which will verify the token recieved from the OAuth, then redirect you finally to https://torbox.app/{provider}/success?token={token}&expires_in={expires_in}&expires_at={expires_at} #### Providers: - "google" -> Google Drive - "dropbox" -> Dropbox - "discord" -> Discord - "onedrive" -> Azure AD/Microsoft/Onedrive ### Authorization No authorization needed. This is a whitelabel OAuth solution.
QueueGoogleDrive ### Overview Queues a job to upload the specified file or zip to the Google Drive account sent with the google_token key. To get this key, either get an OAuth2 token using /oauth/google or your own solution. Make sure when creating the OAuth link, you add the scope https://www.googleapis.com/auth/drive.file so TorBox has access to the user's Drive. ### Authorization Requires an API key using the Authorization Bearer Header.
QueueOnedrive ### Overview Queues a job to upload the specified file or zip to the OneDrive sent with the onedrive_token key. To get this key, either get an OAuth2 token using /oauth/onedrive or your own solution. Make sure when creating the OAuth link you use the scope files.readwrite.all. This is compatible with all different types of Microsoft accounts. ### Authorization Requires an API key using the Authorization Bearer Header.
QueueGofile ### Overview Queues a job to upload the specified file or zip to the GoFile account sent with the gofile_token (optional). To get this key, login to your GoFile account and go here. Copy the Account API Token. This is what you will use as the gofile_token, if you choose to use it. If you don't use an Account API Token, GoFile will simply create an anonymous file. This file will expire after inactivity. ### Authorization Requires an API key using the Authorization Bearer Header.
Queue1fichier ### Overview Queues a job to upload the specified file or zip to the 1Fichier account sent with the onefichier_token key (optional). To get this key you must be a Premium or Premium Gold member at 1Fichier. If you are upgraded, go to the parameters page, and get an API Key. This is what you will use as the onefichier_token, if you choose to use it. If you don't use an API Key, 1Fichier will simply create an anonymous file. ### Authorization Requires an API key using the Authorization Bearer Header.
GetAllJobs ### Overview Gets all the jobs attached to a user account. This is good for an overall view of the jobs, such as on a dashboard, or something similar. ### Statuses - "pending" -> Upload is still waiting in the queue. Waiting for spot to upload. - "uploading" -> Upload is uploading to the proper remote. Progress will be updated as upload continues. - "completed" -> Upload has successfully been uploaded. Progress will be at 1, and the download URL will be populated. - "failed" -> The upload has failed. Check the Detail key for information. ### Authorization Requires an API key using the Authorization Bearer Header.
GetSpecificJob ### Overview Gets a specifc job using the Job's ID. To get the ID, you will have to Get All Jobs, and get the ID you want. ### Statuses - "pending" -> Upload is still waiting in the queue. Waiting for spot to upload. - "uploading" -> Upload is uploading to the proper remote. Progress will be updated as upload continues. - "completed" -> Upload has successfully been uploaded. Progress will be at 1, and the download URL will be populated. - "failed" -> The upload has failed. Check the Detail key for information. ### Authorization Requires an API key using the Authorization Bearer Header.
GetAllJobsByHash ### Overview Gets all jobs that match a specific hash. Good for checking on specific downloads such as a download page, that could contain a lot of jobs. ### Statuses - "pending" -> Upload is still waiting in the queue. Waiting for spot to upload. - "uploading" -> Upload is uploading to the proper remote. Progress will be updated as upload continues. - "completed" -> Upload has successfully been uploaded. Progress will be at 1, and the download URL will be populated. - "failed" -> The upload has failed. Check the Detail key for information. ### Authorization Requires an API key using the Authorization Bearer Header.

AuthenticateOauth

Overview Allows you to get an authorization token for using the user's account. Callback is located at /oauth/{provider}/callback which will verify the token recieved from the OAuth, then redirect you finally to https://torbox.app/{provider}/success?token={token}&expires_in={expires_in}&expires_at={expires_at} #### Providers: - "google" -> Google Drive - "dropbox" -> Dropbox - "discord" -> Discord - "onedrive" -> Azure AD/Microsoft/Onedrive ### Authorization No authorization needed. This is a whitelabel OAuth solution.

  • HTTP Method: GET
  • Endpoint: /{api_version}/api/integration/oauth/{provider}

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string
provider string

Return Type

any

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.AuthenticateOauth(context.Background(), "apiVersion", "provider")
if err != nil {
  panic(err)
}

fmt.Print(response)

QueueGoogleDrive

Overview Queues a job to upload the specified file or zip to the Google Drive account sent with the google_token key. To get this key, either get an OAuth2 token using /oauth/google or your own solution. Make sure when creating the OAuth link, you add the scope https://www.googleapis.com/auth/drive.file so TorBox has access to the user's Drive. ### Authorization Requires an API key using the Authorization Bearer Header.

  • HTTP Method: POST
  • Endpoint: /{api_version}/api/integration/googledrive

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string
body []byte

Return Type

any

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.QueueGoogleDrive(context.Background(), "apiVersion", request)
if err != nil {
  panic(err)
}

fmt.Print(response)

QueueOnedrive

Overview Queues a job to upload the specified file or zip to the OneDrive sent with the onedrive_token key. To get this key, either get an OAuth2 token using /oauth/onedrive or your own solution. Make sure when creating the OAuth link you use the scope files.readwrite.all. This is compatible with all different types of Microsoft accounts. ### Authorization Requires an API key using the Authorization Bearer Header.

  • HTTP Method: POST
  • Endpoint: /{api_version}/api/integration/onedrive

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string
body []byte

Return Type

any

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.QueueOnedrive(context.Background(), "apiVersion", request)
if err != nil {
  panic(err)
}

fmt.Print(response)

QueueGofile

Overview Queues a job to upload the specified file or zip to the GoFile account sent with the gofile_token (optional). To get this key, login to your GoFile account and go here. Copy the Account API Token. This is what you will use as the gofile_token, if you choose to use it. If you don't use an Account API Token, GoFile will simply create an anonymous file. This file will expire after inactivity. ### Authorization Requires an API key using the Authorization Bearer Header.

  • HTTP Method: POST
  • Endpoint: /{api_version}/api/integration/gofile

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string
body []byte

Return Type

any

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.QueueGofile(context.Background(), "apiVersion", request)
if err != nil {
  panic(err)
}

fmt.Print(response)

Queue1fichier

Overview Queues a job to upload the specified file or zip to the 1Fichier account sent with the onefichier_token key (optional). To get this key you must be a Premium or Premium Gold member at 1Fichier. If you are upgraded, go to the parameters page, and get an API Key. This is what you will use as the onefichier_token, if you choose to use it. If you don't use an API Key, 1Fichier will simply create an anonymous file. ### Authorization Requires an API key using the Authorization Bearer Header.

  • HTTP Method: POST
  • Endpoint: /{api_version}/api/integration/1fichier

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string
body []byte

Return Type

any

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.Queue1fichier(context.Background(), "apiVersion", request)
if err != nil {
  panic(err)
}

fmt.Print(response)

GetAllJobs

Overview Gets all the jobs attached to a user account. This is good for an overall view of the jobs, such as on a dashboard, or something similar. ### Statuses - "pending" -> Upload is still waiting in the queue. Waiting for spot to upload. - "uploading" -> Upload is uploading to the proper remote. Progress will be updated as upload continues. - "completed" -> Upload has successfully been uploaded. Progress will be at 1, and the download URL will be populated. - "failed" -> The upload has failed. Check the Detail key for information. ### Authorization Requires an API key using the Authorization Bearer Header.

  • HTTP Method: GET
  • Endpoint: /{api_version}/api/integration/jobs

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string

Return Type

GetAllJobsOkResponse

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.GetAllJobs(context.Background(), "apiVersion")
if err != nil {
  panic(err)
}

fmt.Print(response)

GetSpecificJob

Overview Gets a specifc job using the Job's ID. To get the ID, you will have to Get All Jobs, and get the ID you want. ### Statuses - "pending" -> Upload is still waiting in the queue. Waiting for spot to upload. - "uploading" -> Upload is uploading to the proper remote. Progress will be updated as upload continues. - "completed" -> Upload has successfully been uploaded. Progress will be at 1, and the download URL will be populated. - "failed" -> The upload has failed. Check the Detail key for information. ### Authorization Requires an API key using the Authorization Bearer Header.

  • HTTP Method: GET
  • Endpoint: /{api_version}/api/integration/job/{job_id}

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string
jobId string

Return Type

[]byte

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.GetSpecificJob(context.Background(), "apiVersion", "jobId")
if err != nil {
  panic(err)
}

fmt.Print(response)

GetAllJobsByHash

Overview Gets all jobs that match a specific hash. Good for checking on specific downloads such as a download page, that could contain a lot of jobs. ### Statuses - "pending" -> Upload is still waiting in the queue. Waiting for spot to upload. - "uploading" -> Upload is uploading to the proper remote. Progress will be updated as upload continues. - "completed" -> Upload has successfully been uploaded. Progress will be at 1, and the download URL will be populated. - "failed" -> The upload has failed. Check the Detail key for information. ### Authorization Requires an API key using the Authorization Bearer Header.

  • HTTP Method: GET
  • Endpoint: /{api_version}/api/integration/jobs/{hash}

Parameters

Name Type Required Description
ctx Context Default go language context
apiVersion string
hash string

Return Type

GetAllJobsByHashOkResponse

Example Usage Code Snippet

import (
  "fmt"
  "encoding/json"
  "torbox-sdk-go/pkg/torboxapiconfig"
  "torbox-sdk-go/pkg/torboxapi"
)

config := torboxapiconfig.NewConfig()
client := torboxapi.NewTorboxApi(config)

response, err := client.Integrations.GetAllJobsByHash(context.Background(), "apiVersion", "hash")
if err != nil {
  panic(err)
}

fmt.Print(response)