API Manual

You can upload files through our API system by using your favority programing languages.

You can upload files with our API:
And you can program in any Programming Languages.

REMOTE UPLOAD : Upload from other cloud/hosting services


FIRST : GET YOUR ACCOUNT ACCESS TOKEN at:
	https://subyshare.com/account/profile
Generate an access token and use it for your works.
Note : access_token is your Subyshare account access token.

1.Register Jobs :

-Adding new jobs to remote.

Format :
	https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=access_token&url=remote_links.

Support (remote links) types:

1-Direct link :
	http(s)://examples.com/abc/xyz.ext .
Example :
	https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=abcdefgh&url=https://www.win-rar.com/fileadmin/winrar-versions/winrar/winrar-x64-611.exe

DROPBOX


2-Dropbox share link,
	example: https://www.dropbox.com/s/xxxxxx/file?dl=0
Example :
	https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=abcdefgh&url=https://www.dropbox.com/s/xxxxxx/file?dl=0

3-Dropbox temporarily links via Dropbox API :

Dropbox temorarily links

-Get the temporarily links from your Dropbox account then push it to our remote API.
The link should be :
https://ucaf.....dl.dropboxusercontent.com/cd/0/get/BsqAH2m6eB5dHd...../file.

-Dropbox temporarily links will be expired in 4 hours, if your jobs are not completed and got ERROR , please get new temporarily links and update your jobs.
+Request Update format :
	https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=access_token&job_id=(JOBID)&update_url=NEW_URL


4-DROPBOX API 2 DOWNLOAD:

Dropbox api download

-You must provide Dropbox access token and the file path in the request.
+Format :
	 https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=access_token&url=https://content.dropboxapi.com/2/files/download&authorization=YOUR_DROPBOX_ACCESS_TOKEN&path=path_of_your_file_in_dropbox

-Example :
https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=abcdefgh&url=https://content.dropboxapi.com/2/files/download&authorization=sl...asunsasyfwoegwgiwhgw&path=/home/abc.mp4

-Dropbox access token will be expired in 4 hours, if your jobs are not completed and got ERROR , please get new Dropbox access token and update your jobs.
+Request Update format :
https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=access_token&update_dropbox_access_token=NEW DROPBOX ACCESS TOKEN&job_id=JOBID1,2,3,4,5,6...
+You can also specify multiple job keys separated by comma.


GOOGLE DRIVE

5-Google share link : https://drive.google.com/file/d/fileID/view?usp=sharing
+Format :
https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=abcdefgh&url=https://drive.google.com/file/d/fileID/view?usp=sharing


6-Google api link : https://www.googleapis.com/drive/v3/files/fileID?alt=media&key=API_key
+ API_key is your Google app API Key, fileID is the fileID of your files , get it in your Google account or in the link you open on browser.
+Format :
https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=abcdefgh&url=https://www.googleapis.com/drive/v3/files/fileID?alt=media&key=API_key


2.Checking Jobs :


+Format :
https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=access_token&job_id=JOB-ID1,2,3,4,5,6....
+You can also specify multiple job keys separated by comma.
RESPONSE : JSON response
	
{
"status":	"200",
"response" :{

             "jobs" :{    	
                         "job_id"    :	"1662977746"
                         "file_size" :  "0"
                         "dl_size"   :	"0"
                         "status"    :	"PENDING"
                         "file"      :	{}
                         "created    :  "2022-09-12 12:15:46"
                         "filename   :	""
                         "speed      :	"0"
                         "error"     :	""
                         "url"       :	"https://github.com/yiisoft/yii2/releases/download/2.0.8/yii-advanced-app-2.0.8.tgz"
                         "updated"    :	"2022-09-12 12:15:46"
                     }

         },
"details": "upload result"
}
Possible values of the jobs status:
- PENDING
- DONE
- MOVING
- ERROR
      Finished jobs :
	
{
status	"200",
response" :{

             "jobs" :{    	
                         "job_id"    :	"1662977746"
                         "file_size" :  "4708302"
                         "dl_size"   :	"4708302"
                         "status"    :	"DONE"
                         "file"      :	{
                                            "created"  :	"2022-09-12 12:44:23"
                                            "file_size":	"4708302"
                                            "file_name":	"yii-advanced-app-2.0.8.tgz"
                                            "file_code":	"bl9cqs2lgl6v"
                                            "folder_id":	"0"
                                            "links"    :	"https://subyshare.com/bl9cqs2lgl6v/yii-advanced-app-2.0.8.tgz.html"
                                        }
                         "created    :  "2022-09-12 12:15:46"
                         "filename   :	"yii-advanced-app-2.0.8.tgz"
                         "speed      :	"0"
                         "error"     :	""
                         "url"       :	"https://github.com/yiisoft/yii2/releases/download/2.0.8/yii-advanced-app-2.0.8.tgz"
                         "updated"    :	"2022-09-12 12:44:23"
                     }

         },
details: "upload result"
}

3.Delete Jobs :


+Format :
	 https://subyshare.com/cgi-bin/rapi.cgi?op=remote&token=access_token&delete=true&job_id=JOB-ID1,2,3,4,5,6....

+You can also specify multiple job keys separated by comma.

================================================================================================



LOCAL UPLOAD : Upload from your devices



Here is examples of using form and CURL
There are 3 steps to use it. 1. Login 2. Get uploading server URL and session id 3. Start upload. CURL Exampe:

1. curl -k --data "login=[YourAccountUsername]&password=[YourAccountPassword]&op=login&api=1" "https://subyshare.com"
GET
2. http://xxx.sbsf.tech/tmp/cgi-bin/cUpload.cgi?utype=prem&upload_id=&sess_id=n6gy5c8ky1dffefg
-xxx : random server ID
-n6gy5c8ky1dffefg : random session ID

3. curl --form file=@YourFiles --form utype=prem --form sess_id=n6gy5c8ky1dffefg http://xxx.sbsf.tech/cgi-bin/cUpload.cgi
-Your Files : please put it at the same directory with Curl

Web Form:

1.
<form method="post" enctype="multipart/form-data" action="https://subyshare.com">
<input type="text" name="login" value="your username">
<input type="password" name="password" value="your password">
<input type="hidden" name="op" value="login">
<input type="hidden" name="api" value="1">
<input type="submit">
</form>

2.
http://xxx.sbsf.tech/cgi-bin/cUpload.cgi?utype=prem&upload_id=&sess_id=n6gy5c8ky1dffefg
3.
<form method="post" enctype="multipart/form-data" action="http://xxx.sbsf.tech/cgi-bin/cUpload.cgi">
<input type="file" name="file" value="xxx.rar">
<input type="hidden" name="type" value="prem">
<input type="hidden" name="sess_id" value="xxxxx">
<input type="submit">
</form>

================================================================================================



DOWNLOAD FILES



FIRST : GET YOUR ACCOUNT ACCESS TOKEN at:
	https://subyshare.com/account/profile
Generate an access token and use it for your works.
Note : access_token is your Subyshare account access token.
REQUEST:
Format :
	https://subyshare.com/cgi-bin/rapi.cgi?op=download&token=access_token&file_id=xxxxxx.
Required params:
- token - Access Token .
- file_id - The file's code .
Example : File link
	https://subyshare.com/xxxxxx/abc.mp4.
xxxxxx : is file's code.


RESPONSE : JSON response
SUCCESS:
	
 {
  "response":{ 
             "download_url":"https://sbsxxx/yyyy/zzzz/filename"
              },
  "status":"200",
  "time":"Fri Mar 31 14:37:49 2023",
  "name":"dsvr-1217-7.mp4",
  "size":"12135704947"
 }

ERROR:
	
 {
  "response":"Not Found",
  "status":"404",
  "time":"Fri Mar 31 14:37:49 2023",
  "error":"File Not found",
 }
ERROR:
	
 {
  "response":"Bandwidth Limit Exceeded",
  "status":"509",
  "time":"Fri Mar 31 14:37:49 2023",
  "error":"Purchase more bandwidth",
 }

Questions ?