UploadGig
API
Please attention: This document is under development.

Get Upload Action:

To upload files in UploadGig, you need permission and action URL. this API will help you to give this information.

  • API address: https://uploadgig.com/api/get_upload_action
  • Method: post
  • Request:
    • user : account's username
    • pass : account's password
  • Response (json):
    • code (int) response code
    • result body of response
Response Note: If code parameter is equal to 1, it means this process was successful, and result parameter contains an array that has all of the upload information. In all other cases, the result contains an error string.

Example:

$username = '[email protected]';
$password = '123';
$ch = curl_init('https://uploadgig.com/api/get_upload_action');
curl_setopt( $ch, CURLOPT_POSTFIELDS, array(
    'user' => $username,
    'pass' => $password
));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 2);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
echo $response;
import requests

username = '[email protected]'
password = '123'
action_api_url = 'https://uploadgig.com/api/get_upload_action'

response = requests.post(action_api_url, data={
    'user': username,
    'pass': password
}, allow_redirects=True, timeout=5)
print(response.text)
package main

import (
    "net/http"
    "net/url"
    "fmt"
    "bytes"
)

func GetAction(username string, password string) string {
    action_api_url := "https://uploadgig.com/api/get_upload_action"
    data := url.Values{};
    data.Add("user", username)
    data.Add("pass", password)
    response, err := http.PostForm(action_api_url, data)
    if err == nil {
        buf := new(bytes.Buffer)
        buf.ReadFrom(response.Body)
        return buf.String()
    } else {
        return ""
    }
}

func main() {
    username := "[email protected]"
    password := "123"
    fmt.Println(GetAction(username, password))
}

Output (successful):

{
  code: "1",
  result: {
    action: "http://xxx.xxx.xxx.xxx/upload/yyyyyyyyyyyyyyyy",
    cmbs: 10240
  }
}
Note: cmbs is the max of allowed upload size (in megabyte) to this action.

Output (failed):

{
  code: "0",
  result: "Email or password was incorrect!"
}