Version no : 0.9.5.2
Last Update 2018-11-26
In order to receive an access_token, you must do the following:
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "ListDevices" | string |
Headers | Info | ||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||
ErrorMessage |
|
[
{
"GUID": string,
"DeviceName":string,
"HotCapacity": long,
"ColdCapacity": long,
"UsedSpace": long,
"ColdUsedSpace":long,
"Status": int,
"CreateDate": long,
"LastActivityDate": long,
"NickName":string,
"DeviceType": int,
"DeviceSubType": int,
"OCRLimit": int,
"UsedOCR": int,
"IsCustomDevice": bool
}
]
Parameter Name | Description | Type |
GUID | Shows the device GUID. | bool |
DeviceName | Shows the Device name. | int |
HotCapacity | Shows the device hot capacity in bytes. In case the value is -1 that means that there is no limit. | long |
ColdCapacity | Shows the device cold capacity in bytes. In case the value is -1 that means that there is no limit. | long |
UsedSpace | Shows the device hot storage used Space on bytes. | long |
ColdUsedSpace | Shows the device cold storage used Space in bytes. | long |
Status | Shows the status of the device ( Active = 0 , Suspend =1, Archive =2, PendingActivate =3) | int |
CreateDate | Shows the file creation date. (FileTime UTC) | long |
LastActivityDate | Shows the last activity date.(FileTime UTC) | long |
NickName | Shows the nickname of the device (Base64). | string |
DeviceType | Shows the device main type ( PC = 0 , Vault = 1 , Mobile = 2 ). | int |
DeviceSubType | Shows the device sub type ( Desktop = 0 , Laptop = 1, Vault = 2, Android = 4, IPhone = 5 ) | int |
OCRLimit | Shows the Device OCR limit. In case the value is -1 that means that there is no limit. | int |
UsedOCR | Shows the number of used OCR. | int |
IsCustomDevice | Show if the Device is created by the public APIs or not. | bool |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ListDevices");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
string responseBody = string.Empty;
//Read the response body
using (var reader = new System.IO.StreamReader(response.GetResponseStream()))
{
responseBody = reader.ReadToEnd();
}
Response.ContentType = "application/json";
Response.Write(responseBody);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ListDevices');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//the request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
Request();
?>
Parameter Name | Description | Type | Values | ||||||||||
ResellerTokenrequired | The Reseller Token | string | |||||||||||
ClientIDrequired | The client ID Provided. | string | |||||||||||
ClientSecretrequired | The client secret provided. | string | |||||||||||
Actionrequired | The action name"CreateDevice" | string | |||||||||||
DeviceNamerequired | The Device Name (Base64). | string | |||||||||||
NickNameoptional | The Device NickName (Base64). | string | |||||||||||
HotCapacityoptional | Set the hot storage capacity in giga bytes. default is no limit. The value -1 is no limit. | int | |||||||||||
ColdCapacityoptional | Set the cold storage capacity in giga bytes. default is no limit. The value -1 is no limit. | int | |||||||||||
OCRLimitoptional | Set the device OCR limit. default is no limit. The value -1 is no limit. | int | |||||||||||
DeviceTyperequired | Set the device Type. | int |
|
||||||||||
DeviceSubTyperequired | Set the device syb Type. | int |
|
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
[
{
"GUID": string,
"DeviceName":string,
"HotCapacity": long,
"ColdCapacity": long,
"Status": int,
"CreateDate": long,
"NickName":string,
"DeviceType": int,
"DeviceSubType": int,
"OCRLimit": int,
"IsCustomDevice": bool
}
]
Parameter Name | Description | Type |
Guid | Shows the device GUID. | bool |
DeviceName | Shows the Device name. | int |
NickName | Shows the nickname of the device (Base64). | string |
HotCapacity | Shows the device hot capacity in bytes. In case the value is -1 that means that there is no limit. | long |
ColdCapacity | Shows the device cold capacity in bytes. In case the value is -1 that means that there is no limit. | long |
Status | Shows the status of the device ( Active = 0 , Suspend =1, Archive =2, PendingActivate =3) | int |
CreateDate | Shows the file creation date. (FileTime UTC) | long |
DeviceType | Shows the device main type ( PC = 0 , Vault = 1 , Mobile = 2 ). | int |
DeviceSubType | Shows the device sub type ( Desktop = 0 , Laptop = 1, Vault = 2, Android = 4, IPhone = 5 ) | int |
OCRLimit | Shows the Device OCR limit. In case the value is -1 that means that there is no limit. | int |
IsCustomDevice | Show if the Device is created by the public APIs or not. | bool |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "CreateDevice");
//The Request DeviceName Header
request.Headers.Add("DeviceName", "VGVzdERldmljZQ==");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string body = string.Empty;
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: CreateDevice',
//The Request DeviceName Header
'DeviceName: VGVzdERldmljZQ==');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//the request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID Provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "DeleteDevice" | string |
DeviceGUIDrequired | The required Device GUID to be deleted | string |
Headers | Info | ||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "DeleteDevice");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "FC2F250F97B7478F8DA450114A214D3E");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
//the device has been deleted.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch (Exception)
{
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: DeleteDevice',
//The Request DeviceGUID Header
'DeviceGUID: FC2F250F97B7478F8DA450114A214D3E');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//the request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientID required | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "SearchFiles" | string |
DeviceGUIDoptional | The GUID of the required device to make search on, default is null and the search will be done on all the devices on the user account. | string |
PageIndexrequired | The page index | int |
PageLimitrequired | Files in each page limit (max number is 50) | int |
{
"SearchQuery":string,
"SearchFields":int,
"SizeFilter":int,
"CustomSizeFrom":int,
"CustomSizeTo":int,
"DateModifyFilter":int,
"CustomDateModifyFrom":int,
"CustomDateModifyTo":int,
"DocumentTypeFilter":int,
"OCRTypeFilter":int,
"OtherExtentionFilter":string,
"OtherExcludeExtentions":[list of string,{string},{string},{...}],
"AudioExtentionFilter":string,
"AudioExcludeExtentions":[list of string,{string},{string},{...}],
"AudioDurationFilter":int,
"CustomAudioFrom":int,
"CustomAudioTo":int,
"VideoExtentionFilter":string,
"VideoExcludeExtentions":[list of string,{string},{string},{...}],
"VideoDurationFilter":int,
"CustomVideoFrom":long,
"VideoDimensionFilter":int,
"CustomVideoTo":int,
"CustomVideoWidth":int,
"CustomVideoHeight":long,
"PicExtentionFilter":string,
"PicExcludeExtentions":[list of string,{string},{string},{...}],
"PicDimensionFilter":int,
"CustomPicWidth":int,
"CustomPicHeight":int,
"PicCameraType":string,
"PicColorTypeFilter":int,
"PicDateCreation":int,
"CustomPicCreationDateFrom":int,
"CustomPicCreationDateTo":int,
"TypeFilter":int,
"SortType":int,
"SearchTags":bool,
"NeedAggregates":int,
"IsFromTagSuggested":bool,
"FilterPath":int,
"SearchMode":int,
"TagType":int
}
Parameter Name | Description | Type | Values | ||||||||||||||||||||||||||||||||
SearchQuery optional | search query of what the user wants. | string | To get all files send the value of the SearchQuery as empty. | ||||||||||||||||||||||||||||||||
SearchFields optional | you can specify what the user want to search
Send the Value. |
int |
|
||||||||||||||||||||||||||||||||
TypeFilter optional | filter the type of files to search in.
Send the Value. |
int |
|
||||||||||||||||||||||||||||||||
SizeFilter optional | This filter is used for if the user want to filter his result using Size.
if the user sent the value as "Custom"
then these filters must be sent : CustomSizeFrom , CustomSizeTo
for sizeFilter
Send the Value. |
int |
|
||||||||||||||||||||||||||||||||
CustomSizeFrom optional | This needs to be sent if user choose a custom size filter and it must be in bytes. | long | |||||||||||||||||||||||||||||||||
CustomSizeTo optional | This needs to be sent if SizeFilter is set to custom and it must be in bytes. | long | |||||||||||||||||||||||||||||||||
DateModifyFilter optional | This filter is used for if the user want to filter his result using Date Modify, in this filter if send it as Custom
you must send the CustomDateModifyFrom and CustomDateModifyTo ..
for DateModifyFilter
Send the Value. |
int |
|
||||||||||||||||||||||||||||||||
CustomDateModifyFrom optional | This needs to be sent if DateModifyFilter is set to custom and it must be in long “FileTime” | string | |||||||||||||||||||||||||||||||||
CustomDateModifyTo optional | This needs to be sent if DateModifyFilter is set to custom and it must be in long “FileTime” | string | |||||||||||||||||||||||||||||||||
DocumentTypeFilter optional | This filter used when TypeFilter value is document .
choose the document type ..
Send the Value |
int |
|
||||||||||||||||||||||||||||||||
OCRTypeFilter optional | This filter used when TypeFilter value is ocr.
then choose the ocr type .. Send the Value |
string |
|
||||||||||||||||||||||||||||||||
OtherExtentionFilter optional | This filter used if TypeFilter is set to other and the value will be string for the specific extension that the user choose. | string | |||||||||||||||||||||||||||||||||
OtherExcludeExtentions optional | This will be sent only TypeFilter is set to other. | string | |||||||||||||||||||||||||||||||||
AudioExtentionFilter optional | This filter used when TypeFilter value is audio. choose the Extension Filter and the value will be string for the specific extension that the user choose. if the value is “other” in the AudioExtentionFilter. | string | |||||||||||||||||||||||||||||||||
AudioExcludeExtentions optional | This will be sent only if TypeFilter value is “audio”. | string | |||||||||||||||||||||||||||||||||
AudioDurationFilter optional | This filter used when TypeFilter value is audio.
choose Duration Filter, in this filter If you send “Custom” then you will need to send CustomAudioFrom And CustomAudioTo. for AudioDurationFilter .. send the Value |
int |
|
||||||||||||||||||||||||||||||||
CustomAudioFrom optional | This needs to be sent if AudioDurationFilter is set to custom | long | |||||||||||||||||||||||||||||||||
CustomAudioTo optional | This needs to be sent if AudioDurationFilter is set to custom. | long | |||||||||||||||||||||||||||||||||
VideoExtentionFilter optional | This filter used when TypeFilter is set to video.
choose the Extension Filter and the value will be string for the specific extension that the user choose. if “other” is the value of VideoExtentionFilter the you need to Send VideoExcludeExtentions filter values. |
string | |||||||||||||||||||||||||||||||||
VideoExcludeExtentions optional | This will be sent only if TypeFilter is set to video. the values will be the extensions that we return to you from the aggregations. | string | |||||||||||||||||||||||||||||||||
VideoDurationFilter optional | This filter used when TypeFilter is set to video.
In this filter if send "custom" then you will need to send CustomVideoFrom filter and CustomVideoTo. for VideoDurationFilter .. Send the Value |
int |
|
||||||||||||||||||||||||||||||||
CustomVideoFromoptional | This needs to be sent if VideoDurationFilter is set to custom. | long | |||||||||||||||||||||||||||||||||
CustomVideoTo optional | This needs to be sent if VideoDurationFilter is set to custom. | long | |||||||||||||||||||||||||||||||||
VideoDimensionFilter optional | This filter used when TypeFilter value is video.
If you send “Custom” then you will need to send CustomVideoWidth filter and CustomVideoTo filter. for VideoDimensionFilter .. Send the Value |
int |
|
||||||||||||||||||||||||||||||||
CustomVideoWidth optional | This needs to be sent if VideoDimensionFilter is set to custom. | long | |||||||||||||||||||||||||||||||||
CustomVideoHeight optional | This needs to be sent if VideoDimensionFilter is set to custom. | long | |||||||||||||||||||||||||||||||||
PicExtentionFilter optional | This filter used when TypeFilter value is photo. the value will be string for the specific extension that the user choose and if he choose “other” from the Extension Filter then you need to send the value “other” and you need to send PicExcludeExtentions filter. |
string | |||||||||||||||||||||||||||||||||
PicExcludeExtentions optional | This will be sent only if TypeFilter is set to other. | string | |||||||||||||||||||||||||||||||||
PicDimensionFilter optional | This filter used when TypeFilter is set to photo.
choose Dimension Filter which will return photos larger than the selected filter. If you send “Custom” then you will need to send CustomPicWidth filter and CustomPicHeight filter. for PicDimensionFilter .. Send the Value |
int |
|
||||||||||||||||||||||||||||||||
CustomPicWidth optional | This needs to be sent if PicDimensionFilter is set to custom. | long | |||||||||||||||||||||||||||||||||
CustomPicHeight optional | This needs to be sent if PicDimensionFilter is set to custom | long | |||||||||||||||||||||||||||||||||
PicCameraType optional | This filter value must contatin the camera full name ,This filter used if TypeFilter is set to "photo" and SearchFields is set to "Camera Name" | string | |||||||||||||||||||||||||||||||||
PicColorTypeFilter optional | This filter used if TypeFilter is set to photo
..
Send the Value |
int |
|
||||||||||||||||||||||||||||||||
PicDateCreation optional | This filter used TypeFilter is set to photo.
If you send “Custom” then you will need to send CustomPicCreationDateFrom filter and CustomPicCreationDateTo filter.
for PicDateCreation ..
Send the Value |
int |
|
||||||||||||||||||||||||||||||||
CustomPicCreationDateTo optional | This needs to be sent if PicDateCreation is set to custom | long | |||||||||||||||||||||||||||||||||
CustomPicCreationDateFrom optional | This needs to be sent if PicDateCreation is set to custom | long | |||||||||||||||||||||||||||||||||
SortType optional | filter the Sort type of the files to show.
Send the Value |
int |
|
||||||||||||||||||||||||||||||||
SearchTags optional | if sent as true, the search will get the files with specific tags | bool | |||||||||||||||||||||||||||||||||
IsFromTagSuggested optional | If sent true the result will be the files with the tag of "examlpe" And the files with the tags that contains the characters "examlpe" and you must send “SearchTags” Filter as true.
if send as false , the result will be the files with the tag of "example" only |
bool | |||||||||||||||||||||||||||||||||
FilterPath optional | Send the parent path to search in size specific folder. | string | |||||||||||||||||||||||||||||||||
SearchMode optional | This filter used to when you want to get files from Search/Browse/Favorites Files | int |
|
||||||||||||||||||||||||||||||||
TagType optional | This filter used for AI Tags and you must send "SearchTags" Filter as true to read this filter ..
Send the Value |
int |
|
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": false,
"NextPageIndex": 0,
"Files": [
{
"FileGUID":string,
"FileType": string,
"FileName": string,
"Extension": string,
"FileSize": long,
"ModificationDate": long,
"IsFavoriteFile": bool,
"FilePath": string,
"TranscodedSdSize": long,
"TranscodedHdSize": long,
"WidthResolution": long,
"HieghtResolution": long,
"ParentPath": string,
"IsFolder": bool,
"DocumentLanguage": string,
"PageCount": int,
"SmallThumbURL": string,
"MeduimThumbURL": string,
"CroppedThumbURL": string,
"LargeThumbURL": string,
"TranscodedVideoSdURL": string,
"TranscodedVideoHdURL": string,
"TranscodedAudioURL": string,
"IsColdFile":bool,
"DeviceName" : string
}
]
}
Parameter Name | Description | Type |
IsThereMore | Shows that is there more files on the next page or not | bool |
NextPageIndex | Shows From which file index the next page will start | int |
FileName | The File Name ( base64 ) | string |
FileGUID | The file GUID | string |
FileType | The Type of the file ( documents , video , audio , photos , ocr , folders , raw files ) | string |
FileName | The name Of the file | string |
Extension | The file extension | string |
FileSize | The size of the file in bytes | long |
ModificationDate | The file modification Date (FileTime UTC) | long |
IsFavoriteFile | Shows Is the file favorite or not | bool |
FilePath | The file full Path | string |
TranscodedSdSize | Shows the sd size in bytes for the vedio file. | long |
TranscodedHdSize | Shows the hd size in bytes for the vedio file. | long |
WidthResolution | Shows the width resolution for the video file. | int |
HieghtResolution | Shows the hieght resolution for the video file. | int |
ParentPath | The Parent File Path (Base64). | string |
IsFolder | indicats if the file is folder or not. | bool |
DocumentLanguage | Show the Document Language. | string |
PageCount | Shows the page count for the document file. | int |
SmallThumbURL | Shows the small thumb URL for images and videos (if exists) | string |
MeduimThumbURL | Shows the meduim thumb URL for images and videos (if exists) | string |
CroppedThumbURL | Shows the cropped thumb URL for images only (if exists) | string |
LargeThumbURL | Shows the Large thumb URL for images only (if exists) | string |
TranscodedVideoSdURL | Shows the sd video URL for the file. | string |
TranscodedVideoHdURL | Shows the hd video URL for videos that have HD video only (if exists) | string |
TranscodedAudioURL | Shows the audio URL for audio files only. | string |
IsColdFile | Shows if the file is a cold storage file or not. | bool |
DeviceName | The device name that the file belongs to. (base64) | string |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "POST";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "SearchFiles");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request PageIndex Header
request.Headers.Add("PageIndex", "0");
//The Request PageLimit Header
request.Headers.Add("PageLimit", "50");
//The Request Body
string body = "{'SearchQuery':' '}";
var encoding = ASCIIEncoding.ASCII;
byte[] bytes = encoding.GetBytes(body);
request.ContentLength = bytes.Length;
using (Stream stream = request.GetRequestStream())
{
stream.Write(bytes, 0, bytes.Length);
}
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string responseBody = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
responseBody = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(responseBody);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//the request
$body = "{'SearchQuery':' '}";
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: SearchFiles',
//The Request DeviceGUID Header
'DeviceGUID: FC2F250F97B7478F8DA450114A214D3E',
'PageIndex: 0',
'PageLimit:50');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "POST",
//The request body
CURLOPT_POSTFIELDS => ($body)
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//the request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientID required | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "GetFileInfo" | string |
DeviceGUIDrequired | The GUID of the required device. | string |
FileGUIDrequired | The GUID of the required file. | string |
Headers | Info | ||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
{
"FileGUID":string,
"FileType": string,
"FileName": string,
"FileFullPath": string,
"Extension": string,
"FileSize": long,
"ModificationDate": long,
"IsFavoriteFile": bool,
"TranscodedSdSize": long,
"TranscodedHdSize": long,
"WidthResolution": long,
"HieghtResolution": long,
"ParentPath": string,
"IsFolder": bool,
"DocumentLanguage": string,
"PageCount": int,
"SmallThumbURL": string,
"MeduimThumbURL": string,
"CroppedThumbURL": string,
"LargeThumbURL": string,
"TranscodedVideoSdURL": string,
"TranscodedVideoHdURL": string,
"TranscodedAudioURL": string,
"FileDownloadURL": string,
"Tags": string array,
"IsColdFile": bool,
"Camera" : string,
"DeviceName": string,
"CreationDate": long,
"UploadDate": long
}
}
Parameter Name | Description | Type |
FileGUID | The file GUID | string |
FileType | The Type of the file ( documents , video , audio , photos , ocr , folders , raw files ) | string |
FileName | The File Name ( base64 ) | string |
FileFullPath | Shows the Full Path of the file ( base64 ). | string |
Extension | The file extension | string |
FileSize | The size of the file in bytes | long |
ModificationDate | The file modification Date (FileTime UTC) | long |
IsFavoriteFile | Shows Is the file favorite or not | bool |
TranscodedSdSize | Shows the sd size in bytes for the vedio file. | long |
TranscodedHdSize | Shows the hd size in bytes for the vedio file. | long |
WidthResolution | Shows the width resolution for the video file. | int |
HieghtResolution | Shows the hieght resolution for the video file. | int |
ParentPath | The Parent File Path (Base64). | string |
IsFolder | indicats if the file is folder or not. | bool |
DocumentLanguage | Show the Document Language. | string |
PageCount | Shows the page count for the document file. | int |
SmallThumbURL | Shows the small thumb URL for images and videos (if exists) | string |
MeduimThumbURL | Shows the meduim thumb URL for images and videos (if exists) | string |
CroppedThumbURL | Shows the cropped thumb URL for images only (if exists) | string |
LargeThumbURL | Shows the Large thumb URL for images only (if exists) | string |
TranscodedVideoSdURL | Shows the sd video URL for the file. | string |
TranscodedVideoHdURL | Shows the hd video URL for videos that have HD video only (if exists) | string |
TranscodedAudioURL | Shows the audio URL for audio files only. | string |
FileDownloadURL | Shows the original download URL for the file. | string |
Tags | Shows the file tags. | string array |
IsColdFile | Shows if the file is a cold storage file or not. | bool |
Camera | Shows the Camera Type of the file. | string |
DeviceName | Shows the device Name of the file. | string |
CreationDate | Shows the create date of the file (FileTime UTC). | long |
UploadDate | Shows the upload date of the file (FileTime UTC). | long |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "GetFileInfo");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The request succeeded.
// Write Your code Here to retreave the Response Body ...
string responseBody = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
responseBody = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(responseBody);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: GetFileInfo',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//the request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "AddTagsByFileGUID" | string |
DeviceGUIDrequired | The GUID of the required Device | string |
FileGUIDrequired | The GUID of the required File. | string |
[
{"Tags": string}
]
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The Request Method
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "POST";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "AddTagsByFileGUID");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
//The Request Body
string body = "[{ 'Tags': 'tag1,tag2,tag3'}]";
var encoding = ASCIIEncoding.ASCII;
byte[] bytes = encoding.GetBytes(body);
request.ContentLength = bytes.Length;
Stream stream = request.GetRequestStream();
stream.Write(bytes, 0, bytes.Length);
WebResponse response = request.GetResponse();
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The request Body
$body = "[{ 'Tags': 'tag1,tag2,tag3'}]";
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: AddTagsByFileGUID',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "POST",
//The request body
CURLOPT_POSTFIELDS => ($body)
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//the request is successful.
echo 'Tags Added successfully';
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "UpdateTagsByFileGUID" | string |
DeviceGUIDrequired | The GUID of the required Device | string |
FileGUIDrequired | The GUID of the required File. | string |
[
{"Tags": string}
]
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "POST";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "UpdateTagsByFileGUID");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
//The Request Body
string body = "[{ 'Tags': 'tag1,tag2,tag3'}]";
var encoding = ASCIIEncoding.ASCII;
byte[] bytes = encoding.GetBytes(body);
request.ContentLength = bytes.Length;
Stream stream = request.GetRequestStream();
stream.Write(bytes, 0, bytes.Length);
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The request Body
$body = "[{ 'Tags': 'tag1,tag2,tag3'}]";
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: UpdateTagsByFileGUID',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "POST",
//The request body
CURLOPT_POSTFIELDS => ($body)
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "AddFavoriteFile" | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
FileGUIDrequired | The GUID of the required File. | string |
Headers | Info | ||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "AddFavoriteFile");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: AddFavoriteFile',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566'
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "RemoveFavoriteFile" | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
FileGUIDrequired | The GUID of the required File. | string |
Headers | Info | ||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "RemoveFavoriteFile");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: RemoveFavoriteFile',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type | Values | ||||||||||||||||||||||||||||||||||||||||||||
ResellerTokenrequired | The Reseller Token | string | |||||||||||||||||||||||||||||||||||||||||||||
ClientIDrequired | The client ID provided. | string | |||||||||||||||||||||||||||||||||||||||||||||
ClientSecretrequired | The client secret provided. | string | |||||||||||||||||||||||||||||||||||||||||||||
Actionrequired | The action name"OCRFileByFileGUID" | string | |||||||||||||||||||||||||||||||||||||||||||||
DeviceGUIDrequired | The GUID of the required Device. | string | |||||||||||||||||||||||||||||||||||||||||||||
FileGUIDrequired | The GUID of the required File. | string | |||||||||||||||||||||||||||||||||||||||||||||
OCRLanguagerequired | The language Of the written Text in the file. Send the Value of the language as specified. | int |
|
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "OCRFileByFileGUID");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
//The Request OCRLanguage Header
request.Headers.Add("OCRLanguage", "4");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: OCRFileByFileGUID',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60',
//The Request OCRLanguage Header
'OCRLanguage: 4',);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "DeleteByFileGUID" | string |
DeviceGUIDrequired | The GUID of the required Device | string |
FileGUIDrequired | The GUID of the required File | string |
IsVersionoptional | The file is version or not. | bool |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "DeleteByFileGUID");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: DeleteByFileGUID',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "DeleteByFilePath" | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
FilePathrequired | The Path of the required File. (Base64) | string |
Headers | Info | ||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "DeleteByFilePath");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FilePath Header
request.Headers.Add("FilePath", Convert.ToBase64String(Encoding.ASCII.GetBytes("Testfolder/test.jpg"))); //base64string
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: DeleteByFilePath',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FilePath Header
'FilePath:'.base64_encode('test/test.jpg');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name"ListFilesByParentGUID" | string |
DeviceGUIDrequired | The GUID of the required Device | string |
FileGUID optional | The parent File GUID. | string |
PageIndexrequired | Page index number | int |
PageLimitrequired | number of files To Show in each page (max number is 1000) | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": false,
"NextPageIndex": null,
"Files": [
{
"FileFullPath":string,
"FileName": string,
"FileSize": long,
"FileGUID": string,
"IsFolder": bool,
"DeviceType": int,
"DeviceSubType": int,
"CreateDate": long,
"ModificationDate" : long,
"UploadDate" : long
}
]
}
Parameter Name | Description | Type |
FullName | The File Name ( base64 ) | string |
FileFullPath | Shows the Full Path of the file ( base64 ). | string |
FileSize | Shows the size of the file by bytes. | long |
FileGUID | Shows the file GUID. | string |
IsFolder | indicats if the device is of type folder or not. | bool |
DeviceType | Shows the device main type ( PC = 0 , Vault = 1 , Mobile = 2 ). | int |
DeviceSubType | Shows the device sub type ( Desktop = 0 , Laptop = 1, Vault = 2, Android = 4, IPhone = 5 ) | int |
UploadDate | Shows the file upload date (FileTime UTC). | long |
ModificationDate | Shows the file modification date (FileTime UTC). If the file is of type folder then the value will be null. | long |
CreateDate | Shows the file create date (FileTime UTC). If the file is of type folder then the value will be null. | long |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ListFilesByParentGUID");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
//The Request PageIndex Header
request.Headers.Add("PageIndex", "0");
//The Request PageLimit Header
request.Headers.Add("PageLimit", "1000");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string body = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ListFilesByParentGUID',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FilePGUID: 6F7381473A094790B479D5CF7B3E3D60',
//The Request PageIndex Header
'PageIndex: 0,
//The Request PageLimit Header
'PageLimit: 2');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "ListAllFilesByParentGUID" | string |
DeviceGUIDrequired | The GUID of the required Device | string |
FileGUID optional | The parent File GUID. | string |
PageIndexrequired | Page index number | int |
PageLimitrequired | Number of files To Show in each page (max number is 1000) | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": bool,
"NextPageIndex": int,
"Files": [
{
"FileFullPath":string,
"FileName": string,
"FileSize": long,
"UploadDate":long,
"FileGUID": string,
"IsFolder": bool,
"DeviceType": int,
"DeviceSubType": int,
"CreateDate": long,
"ModificationDate" : long,
"UploadDate" : long
}
]
}
Parameter Name | Description | Type |
FullName | The File Name ( base64 ) | string |
FileFullPath | Shows the Full Path of the file ( base64 ). | string |
FileSize | Shows the size of the file by bytes. | int |
FileGUID | Shows the file GUID. | string |
IsFolder | Indicats if the device is of type folder or not. | string |
DeviceType | Shows the device main type ( PC = 0 , Vault = 1 , Mobile = 2 ). | int |
DeviceSubType | Shows the device sub type ( Desktop = 0 , Laptop = 1, Vault = 2, Android = 4, IPhone = 5 ) | int |
UploadDate | Shows the file upload date (FileTime UTC). | long |
ModificationDate | Shows the file modification date (FileTime UTC). If the file is of type folder then the value will be null. | long |
CreateDate | Shows the file create date (FileTime UTC). If the file is of type folder then the value will be null. | long |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ListAllFilesByParentGUID");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
//The Request PageIndex Header
request.Headers.Add("PageIndex", "0");
//The Request PageLimit Header
request.Headers.Add("PageLimit", "1000");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string body = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ListAllFilesByParentGUID',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60',
//The Request PageIndex Header
'PageIndex: 0,
//The Request PageLimit Header
'PageLimit: 2');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientID required | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Action required | The action name "ListFilesByParentPath" | string |
DeviceGUIDrequired | The GUID of the required Device | string |
ParentPathoptional | The Parent File Path (Base64). In case this header is not sent this API will return all the files in the selected device. | string |
PageIndexrequired | Page index number | int |
PageLimitrequired | Number of files To Show in each page (max number is 1000) | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": bool,
"NextPageIndex": int,
"Files": [
{
"FileFullPath":string,
"FileName": string,
"FileSize": long,
"FileGUID": string,
"IsFolder": bool,
"DeviceType": int,
"DeviceSubType": int,
"CreateDate": long,
"ModificationDate" : long,
"UploadDate" : long
}
]
}
Parameter Name | Description | Type |
FullName | The File Name ( base64 ) | string |
FileFullPath | Shows the Full Path of the file ( base64 ). | string |
FileSize | Shows the size of the file by bytes. | int |
FileGUID | Shows the file GUID. | string |
IsFolder | indicats if the device is of type folder or not. | string |
DeviceType | Shows the device main type ( PC = 0 , Vault = 1 , Mobile = 2 ). | int |
DeviceSubType | Shows the device sub type ( Desktop = 0 , Laptop = 1, Vault = 2, Android = 4, IPhone = 5 ) | int |
UploadDate | Shows the file upload date (FileTime UTC). | long |
ModificationDate | Shows the file modification date (FileTime UTC). If the file is of type folder then the value will be null. | long |
CreateDate | Shows the file create date (FileTime UTC). If the file is of type folder then the value will be null. | long |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ListFilesByParentPath");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("ParentPath", Convert.ToBase64String(Encoding.ASCII.GetBytes("test/")));
//The Request PageIndex Header
request.Headers.Add("PageIndex", "0");
//The Request PageLimit Header
request.Headers.Add("PageLimit", "1000");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string body = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ListFilesByParentPath',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request ParentPath Header
'ParentPath:'.base64_encode('test/'),
//The Request PageIndex Header
'PageIndex: 0,
//The Request PageLimit Header
'PageLimit: 2');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "ListAllFilesByParentPath" | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
ParentPathoptional | The Parent File Path (Base64). In case this header is not sent this API will return all the files in the selected device | string |
PageIndexrequired | Page index number. | int |
PageLimitrequired | Number of files To Show in each page (max number is 1000) | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": bool,
"NextPageIndex": int,
"Files": [
{
"FileFullPath":string,
"FileName": string,
"FileSize": long,
"FileGUID": string,
"IsFolder": bool,
"DeviceType": int,
"DeviceSubType": 10,
"CreateDate": long,
"ModificationDate" : long,
"UploadDate" : long
}
]
}
Parameter Name | Description | Type |
FullName | The File Name ( base64 ) | string |
FileFullPath | Shows the Full Path of the file ( base64 ). | string |
FileSize | Shows the size of the file by bytes. | int |
FileGUID | Shows the file GUID. | string |
IsFolder | indicats if the device is of type folder or not. | string |
DeviceType | Shows the device main type ( PC = 0 , Vault = 1 , Mobile = 2 ). | int |
DeviceSubType | Shows the device sub type ( Desktop = 0 , Laptop = 1, Vault = 2, Android = 4, IPhone = 5 ) | int |
UploadDate | Shows the file upload date (FileTime UTC). | long |
ModificationDate | Shows the file modification date (FileTime UTC). If the file is of type folder then the value will be null. | long |
CreateDate | Shows the file create date (FileTime UTC). If the file is of type folder then the value will be null. | long |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ListAllFilesByParentPath");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("ParentPath", Convert.ToBase64String(Encoding.ASCII.GetBytes("testFolder/")));
//The Request PageIndex Header
request.Headers.Add("PageIndex", "0");
//The Request PageLimit Header
request.Headers.Add("PageLimit", "1000");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string body = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ListAllFilesByParentPath',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request ParentPath Header
'ParentPath:'.base64_encode('test/'),
//The Request PageIndex Header
'PageIndex: 0',
//The Request PageLimit Header
'PageLimit: 100');
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "ListFileVersions" | string |
DeviceGUIDrequired | The GUID of the required Device | string |
FileGUIDrequired | The GUID of the required File | string |
PageIndexrequired | Page index number | int |
PageLimitrequired | number of files To Show in each page (max number is 1000) | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": bool,
"NextPageIndex":int,
"Files": [
{
"FileFullPath":string,
"FileName": string,
"FileSize": long,
"VersionNumber": int,
"FileGUID": string,
"IsFolder": bool,
"DeviceType": int,
"DeviceSubType": int,
"CreateDate": long,
"ModificationDate" : long,
"UploadDate" : long
}
]
}
Parameter Name | Description | Type |
FileName | The File Name ( base64 ) | string |
FileFullPath | Shows the Full Path of the file ( base64 ). | string |
FileSize | Shows the size of the file by bytes. | long |
VersionNumber | Shows the file Version Number. | int |
FileGUID | Shows the file GUID. | string |
IsFolder | indicats if the device is of type folder or not. | string |
DeviceType | Shows the device main type ( PC = 0 , Vault = 1 , Mobile = 2 ). | int |
DeviceSubType | Shows the device sub type ( Desktop = 0 , Laptop = 1, Vault = 2, Android = 4, IPhone = 5 ) | int |
IsThereMore | Shows that is there more files on the next page or not | bool |
NextPageIndex | Shows From which file index the next page will start | int |
UploadDate | Shows the file upload date (FileTime UTC). | long |
ModificationDate | Shows the file modification date (FileTime UTC). If the file is of type folder then the value will be null. | long |
CreateDate | Shows the file create date (FileTime UTC). If the file is of type folder then the value will be null. | long |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ListFileVersions");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "6F7381473A094790B479D5CF7B3E3D60");
//The Request FileGUID Header
request.Headers.Add("PageIndex", "0");
//The Request FileGUID Header
request.Headers.Add("PageLimit", "5");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string body = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ListFileVersions',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60',
//The Request PageIndex Header
'PageIndex: 6F7381473A094790B479D5CF7B3E3D60',
//The Request PageLimit Header
'PageLimit: 6F7381473A094790B479D5CF7B3E3D60',
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
ClientID required | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "ListFavoriteFiles" | string |
DeviceGUID optional | The GUID of the required device. | string |
PageIndexrequired | The page index | int |
PageLimitrequired | Files in each page limit (max number is 1000) | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": bool,
"NextPageIndex":int,
"Files": [
{
"FileName": string,
"FileGUID": string,
"FileType": string,
"FileFullPath": string,
"Extension": string,
"FileSize": long,
"ModificationDate": long,
"ParentPath": string,
"IsFolder": bool,
"PageCount": int,
"DeviceName" string
}
]
}
Parameter Name | Description | Type |
FileGUID | Shows the file GUID. | string |
FileType | The Type of the file ( documents , video , audio , photos , ocr , folders , raw files ) | string |
FullName | The File Name ( base64 ) | string |
FileFullPath | Shows the Full Path of the file ( base64 ). | string |
Extension | The file extension | string |
FileSize | Shows the size of the file by bytes. | long |
ModificationDate | Shows the file Modification date. (UTC) | long |
ParentPath | The Parent File Path (Base64). | string |
IsFolder | indicats if the device is of type folder or not. | string |
PageCount | Shows the page count for the document file. | int |
DeviceName | The device name that the file belongs to. (base64) | string |
try
{
//The URL For The API
string requestURL = "https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ListFavoriteFiles");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request PageIndex Header
request.Headers.Add("PageIndex", "0");
//The Request PageLimit Header
request.Headers.Add("PageLimit", "10");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string body = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
// Do whatever you want with the body
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ListFavoriteFiles',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566',
//The Request FileGUID Header
'FileGUID: 6F7381473A094790B479D5CF7B3E3D60',
//The Request PageIndex Header
'PageIndex: 0',
//The Request PageLimit Header
'PageLimit: 100'
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER => 1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER => true,
// CURLOPT_FORBID_REUSE => 1,
//Set the request timeout in milliseconds
CURLOPT_TIMEOUT => 200,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type | Value | ||||||||||||||||||||||||||||||||||||||||||||
ResellerTokenrequired | The Reseller Token | string | |||||||||||||||||||||||||||||||||||||||||||||
DeviceGUIDrequired | The GUID of the required Device | string | |||||||||||||||||||||||||||||||||||||||||||||
ClientIDrequired | The client ID provided. | string | |||||||||||||||||||||||||||||||||||||||||||||
Action required | The action name "Upload" | string | |||||||||||||||||||||||||||||||||||||||||||||
ClientSecret required | The client secret provided. | string | |||||||||||||||||||||||||||||||||||||||||||||
ChunkSize optional | The size of the chunk that is being uploaded, default size is 8388608 bytes, maximum is 104857600 bytes. | int | |||||||||||||||||||||||||||||||||||||||||||||
ChunkOffset required | Determines from which byte the upload handler should resume upload the file. | int | |||||||||||||||||||||||||||||||||||||||||||||
IsLastrequired | Determins if the chunck being uploaded is the last or not. | bool | |||||||||||||||||||||||||||||||||||||||||||||
Tagsoptional | The file Tags ( base64 ) | string | |||||||||||||||||||||||||||||||||||||||||||||
IsFavouriteoptional | Determins if the File is Favourite or Not. | bool | |||||||||||||||||||||||||||||||||||||||||||||
IsOCRoptional | Determins if the File is OCR or Not. | bool | |||||||||||||||||||||||||||||||||||||||||||||
OCRLanguageoptional | The language Of the written Text in the file. this header is required if the header "IsOCR" is sent true. Send the Value of the language as specified. | int |
|
||||||||||||||||||||||||||||||||||||||||||||
FileSizerequired | The length of the file stream. | int | |||||||||||||||||||||||||||||||||||||||||||||
CreationDaterequired | The Creation date time. This header is not required in case the device is a cloud drive device this will be set to current time. |
string | |||||||||||||||||||||||||||||||||||||||||||||
ModificationDaterequired | The Modification date time. | string | |||||||||||||||||||||||||||||||||||||||||||||
FilePathrequired | the file path where we want to save the file in. (base64) | string |
Filestream.
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FileGUID | The uploaded file GUID
This header will be retured if the file is only one chunk or its the last chunk request (if it's chuncked file) |
try
{
string path = @"D:\TestingImages\Test80.rar";
using (FileStream fileStream = File.OpenRead(path))
{
int chunkSize = 8388608;
string fileName = fileStream.Name;
int totalChunks = (int)Math.Ceiling((double)fileStream.Length / chunkSize);
fileStream.Position = 0;
long fileSize = fileStream.Length;
// Loop through the whole stream and send it chunk by chunk;
long chunkOffset = 0;
for (int i = 0; i < totalChunks; i++)
{
int startIndex = i * chunkSize;
int endIndex = (int)(startIndex + chunkSize > fileStream.Length ? fileStream.Length : startIndex + chunkSize);
int length = endIndex - startIndex;
byte[] bytes = new byte[length];
fileStream.Read(bytes, 0, bytes.Length);
bool isLast = i == totalChunks - 1;
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestURL);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.Headers.Add("Action", "Upload");
request.Headers.Add("DeviceGUID", "EB2A42A034E8441C91D10BBB20E3C325");
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
request.Headers.Add("FilePath", Convert.ToBase64String(Encoding.UTF8.GetBytes(fileName)));
request.Headers.Add("Tags", Convert.ToBase64String(Encoding.UTF8.GetBytes("something,idontknow")));
request.Headers.Add("Description", Convert.ToBase64String(Encoding.UTF8.GetBytes("dafgdag")));
request.Headers.Add("ChunkSize", chunkSize.ToString());
request.Headers.Add("ChunkOffset", chunkOffset.ToString());
request.Headers.Add("IsLast", isLast.ToString());
request.Headers.Add("FileSize", fileSize.ToString());
request.Headers.Add("ModificationDate", DateTime.Now.ToFileTimeUtc().ToString());
request.Headers.Add("CreationDate", DateTime.Now.ToFileTimeUtc().ToString());
request.ContentLength = bytes.Length;
using (Stream stream = request.GetRequestStream())
{
stream.Write(bytes, 0, bytes.Length);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Response.Write(response.Headers["ErrorMessage"]);
HttpContext.Current.Response.Flush();
chunkOffset += chunkSize;
}
fileStream.Flush();
fileStream.Dispose();
}
}
catch (Exception ex)
{
throw ex;
}
<\?php
function GetFileSize($filepath) {
$fileSize = sprintf("% u",filesize($filepath));
if($fileSize < 1)
{
exec('dir ' . $filepath, $inf);
$size_raw = $inf[6];
$size_exp = explode("1 File(s)", $size_raw);
$size_txt = explode("bytes", $size_exp[1]);
$size_array = explode(",", $size_txt[0]);
$size = "0";
for($i = 0 ; $i < count($size_array); $i++)
{
$size = $size.trim($size_array[$i]);
}
return (float)$size;
}
else
{
return (float)$fileSize;
}
}
function get_headers_from_curl_response($response)
{
$headers = array();
// $header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $response) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
if($line == "" || $line == NULL || !stripos($line,":")){
continue;
}
list ($key, $value) = explode(':', $line);
if(!($key == null || $value ==null))
{
$headers[$key] = $value;
}
}
return $headers;
}
function PostRequest($FullPath,$chunkOffset,$isLast,$fileSize,$chunkSize, $buffer) {
$url='https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
$body = $buffer;
$headers = array(
//The Request Reseller Token Header
'ResellerToken:3AE7E7F042846E8AF3D0A213727C326',
//The Request ClientID Header
'ClientID:3AE7E7F0332821E8AF3D0A213727C326',
//The Request ClientSecret Header
'ClientSecret: 3AE7E7F0342811E8AF3D0A213727C326',
//The Request Action Header
'Action: Upload',
//The Request FilePath Header
'FilePath:'.base64_encode($FullPath),
//The Request DeviceGUID Header
'DeviceGUID:08311A826AC143E89DBAAC8DA3B414C1',
//The Request Tags Header
'Tags :'.base64_encode('something , idontknow'),
//The Request Description Header
'Description :dafgdag',
//The Request ChunkSize Header
'ChunkSize:'.$chunkSize,
//The Request chunkOffset Header
'ChunkOffset :'.$chunkOffset,
//The Request IsLast Header
'IsLast : '.$isLast,
//The Request FileAttributes Header
'FileAttributes : 0',
//The Request fileSize Header
'FileSize :'.$fileSize,
'ModificationDate : 131821716783898722',
'CreationDate : 131821716783898722'
);
// Post the request to the API Using API URL
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "POST",
//The request body
CURLOPT_POSTFIELDS => ($body)
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER , $headers);
curl_setopt_array($curl_request, $request);
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$responseHeaders = get_headers_from_curl_response($response);
echo "ErrorCode : ".$responseHeaders["ErrorCode"]." , ErrorMessage : ".$responseHeaders["ErrorMessage"];
//Closing the Request object.
curl_close($curl_request);
ob_flush();
flush();
}
function UploadFile($fullPath){
$chunkSize=8388608;
//open file to read
$file_handle = fopen($fullPath,"rb+",true);
//get file size
$fileSize = GetFileSize($fullPath);
//number of parts to split
$parts = ceil($fileSize / $chunkSize);
$chunkOffset = 0;
for($i=0;$i<$parts;$i++){
//read buffer sized amount from file
$buffer = fread($file_handle, $chunkSize);
//Send the Chunck
$isLast=($i==$parts-1)?'true':'false';
$x = PostRequest($fullPath, $chunkOffset,$isLast,$fileSize,$chunkSize, $buffer);
$chunkOffset+=$chunkSize;
}
fclose($file_handle);
}
UploadFile("D:\\TestingImages\\Test94.rar");
?>
Header Name | Description | Type | Value |
ResellerTokenrequired | The Reseller Token | string | |
DeviceGUIDrequired | The GUID of the required Device | string | |
ClientIDrequired | The client ID provided. | string | |
Action required | The action name "UploadColdStorage" | string | |
ClientSecret required | The client secret provided. | string | |
ChunkSize optional | The size of the chunk that is being uploaded, default size is 8388608 bytes, maximum is 104857600 bytes. | int | |
ChunkOffset required | Determines from which byte the upload handler should resume upload the file. | int | |
IsLastrequired | Determins if the chunck being uploaded is the last or not. | bool | |
Tagsoptional | The file Tags ( base64 ) | string | |
FileSizerequired | The length of the file stream. | int | |
CreationDaterequired | The Creation date time. This header is not required in case the device is a cloud drive device this will be set to current time. |
string | |
ModificationDaterequired | The Modification date time. | string | |
FilePathrequired | the file path where we want to save the file in. (base64) | string |
Filestream.
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FileGUID | The uploaded file GUID
This header will be retured if the file is only one chunk or its the last chunk request (if it's chuncked file) |
try
{
string path = @"D:\TestingImages\Test80.rar";
using (FileStream fileStream = File.OpenRead(path))
{
int chunkSize = 8388608;
string fileName = fileStream.Name;
int totalChunks = (int)Math.Ceiling((double)fileStream.Length / chunkSize);
fileStream.Position = 0;
long fileSize = fileStream.Length;
// Loop through the whole stream and send it chunk by chunk;
long chunkOffset = 0;
for (int i = 0; i < totalChunks; i++)
{
int startIndex = i * chunkSize;
int endIndex = (int)(startIndex + chunkSize > fileStream.Length ? fileStream.Length : startIndex + chunkSize);
int length = endIndex - startIndex;
byte[] bytes = new byte[length];
fileStream.Read(bytes, 0, bytes.Length);
bool isLast = i == totalChunks - 1;
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestURL);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.Headers.Add("Action", "UploadColdStorage");
request.Headers.Add("DeviceGUID", "EB2A42A034E8441C91D10BBB20E3C325");
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
request.Headers.Add("FilePath", Convert.ToBase64String(Encoding.UTF8.GetBytes(fileName)));
request.Headers.Add("Tags", Convert.ToBase64String(Encoding.UTF8.GetBytes("something,idontknow")));
request.Headers.Add("Description", Convert.ToBase64String(Encoding.UTF8.GetBytes("dafgdag")));
request.Headers.Add("ChunkSize", chunkSize.ToString());
request.Headers.Add("ChunkOffset", chunkOffset.ToString());
request.Headers.Add("IsLast", isLast.ToString());
request.Headers.Add("FileSize", fileSize.ToString());
request.Headers.Add("ModificationDate", DateTime.Now.ToFileTimeUtc().ToString());
request.Headers.Add("CreationDate", DateTime.Now.ToFileTimeUtc().ToString());
request.ContentLength = bytes.Length;
using (Stream stream = request.GetRequestStream())
{
stream.Write(bytes, 0, bytes.Length);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Response.Write(response.Headers["ErrorMessage"]);
HttpContext.Current.Response.Flush();
chunkOffset += chunkSize;
}
fileStream.Flush();
fileStream.Dispose();
}
}
catch (Exception ex)
{
throw ex;
}
<\?php
function GetFileSize($filepath) {
$fileSize = sprintf("% u",filesize($filepath));
if($fileSize < 1)
{
exec('dir ' . $filepath, $inf);
$size_raw = $inf[6];
$size_exp = explode("1 File(s)", $size_raw);
$size_txt = explode("bytes", $size_exp[1]);
$size_array = explode(",", $size_txt[0]);
$size = "0";
for($i = 0 ; $i < count($size_array); $i++)
{
$size = $size.trim($size_array[$i]);
}
return (float)$size;
}
else
{
return (float)$fileSize;
}
}
function get_headers_from_curl_response($response)
{
$headers = array();
// $header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $response) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
if($line == "" || $line == NULL || !stripos($line,":")){
continue;
}
list ($key, $value) = explode(':', $line);
if(!($key == null || $value ==null))
{
$headers[$key] = $value;
}
}
return $headers;
}
function PostRequest($FullPath,$chunkOffset,$isLast,$fileSize,$chunkSize, $buffer) {
$url='https://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
$body = $buffer;
$headers = array(
//The Request Reseller Token Header
'ResellerToken:3AE7E7F042846E8AF3D0A213727C326',
//The Request ClientID Header
'ClientID:3AE7E7F0332821E8AF3D0A213727C326',
//The Request ClientSecret Header
'ClientSecret: 3AE7E7F0342811E8AF3D0A213727C326',
//The Request Action Header
'Action: UploadColdStorage',
//The Request FilePath Header
'FilePath:'.base64_encode($FullPath),
//The Request DeviceGUID Header
'DeviceGUID:08311A826AC143E89DBAAC8DA3B414C1',
//The Request Tags Header
'Tags :'.base64_encode('something , idontknow'),
//The Request Description Header
'Description :dafgdag',
//The Request ChunkSize Header
'ChunkSize:'.$chunkSize,
//The Request chunkOffset Header
'ChunkOffset :'.$chunkOffset,
//The Request IsLast Header
'IsLast : '.$isLast,
//The Request FileAttributes Header
'FileAttributes : 0',
//The Request fileSize Header
'FileSize :'.$fileSize,
'ModificationDate : 131821716783898722',
'CreationDate : 131821716783898722'
);
// Post the request to the API Using API URL
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "POST",
//The request body
CURLOPT_POSTFIELDS => ($body)
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER , $headers);
curl_setopt_array($curl_request, $request);
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$responseHeaders = get_headers_from_curl_response($response);
echo "ErrorCode : ".$responseHeaders["ErrorCode"]." , ErrorMessage : ".$responseHeaders["ErrorMessage"];
//Closing the Request object.
curl_close($curl_request);
ob_flush();
flush();
}
function UploadFile($fullPath){
$chunkSize=8388608;
//open file to read
$file_handle = fopen($fullPath,"rb+",true);
//get file size
$fileSize = GetFileSize($fullPath);
//number of parts to split
$parts = ceil($fileSize / $chunkSize);
$chunkOffset = 0;
for($i=0;$i<$parts;$i++){
//read buffer sized amount from file
$buffer = fread($file_handle, $chunkSize);
//Send the Chunck
$isLast=($i==$parts-1)?'true':'false';
$x = PostRequest($fullPath, $chunkOffset,$isLast,$fileSize,$chunkSize, $buffer);
$chunkOffset+=$chunkSize;
}
fclose($file_handle);
}
UploadFile("D:\\TestingImages\\Test94.rar");
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
ClientIDrequired | The client ID provided. | string |
Actionrequired | The action name "DownloadSingleFile" | string |
ClientSecretrequired | The client secret provided. | string |
FileGUIDrequired | The file GUID. | string |
IsVersionrequired | The file is version or not. | bool |
Headers | Info | ||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
FileStream
try
{
//The URL For The API
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "DownloadSingleFile");
//The Request FileGUID Header
request.Headers.Add("FileGUID", "FD65861F807A4C66A112569D3FD48111");
//The Request IsVersion Header
request.Headers.Add("IsVersion", "false");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
WebResponse response = request.GetResponse();
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
int bytesReaded = 0;
using (Stream stream = response.GetResponseStream())
{
byte[] buffer = new byte[response.ContentLength];
HttpContext.Current.Response.Headers.Add("Content-Disposition", response.Headers["Content-Disposition"]);
while ((bytesReaded = stream.Read(buffer, 0, buffer.Length)) != 0 && HttpContext.Current.Response.IsClientConnected)
{
HttpContext.Current.Response.OutputStream.Write(buffer, 0, bytesReaded);
HttpContext.Current.Response.OutputStream.Flush();
}
HttpContext.Current.Response.End();
}
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: DownloadSingleFile',
//The Request FileGUID Header
'FileGUID: 40DECD74D5C6428DBEEE17BA5370E21B',
//The Request IsVersion Header
'IsVersion: false',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566'
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "GET"
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers );
curl_setopt_array($curl_request, $request);
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Getting the headers from the response.
$headers =get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
header("Content-Type:".$headers["Content-Type"]);
header("Content-Disposition:".$headers["Content-Disposition"]);
header("Content-Length:".$headers["Content-Length"]);
echo $body;
//The file has been downloaded successfully
//Closing the Request object.
curl_close($curl_request);
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
ClientIDrequired | The client ID provided. | string |
Actionrequired | The action name "DownloadLinks" | string |
ClientSecretrequired | The client secret provided. | string |
[
{"FileGUID": string, "IsVersion":bool}
]
Headers | Info | ||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
{
"FileFullPath":string (base64),
"FileSize": long,
"FileGUID": string,
"FileDownloadURL": string
}
}
Parameter Name | Description | Type |
FileFullPath | Shows the Full Path of the file (base64). | string |
FileSize | Shows the size of the file by bytes. | int |
FileGUID | Shows the file GUID. | string |
FileDownloadURL | Shows the Download link for the file. | string |
try
{
//The URL For The API
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "POST";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "DownloadLinks");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request Body
string body = "[{'FileGUID': 'FD65861F807A4C66A112569D3FD48111', 'IsVersion':'false'},"
+ " { 'FileGUID': 'FD65861F807A4C66A112569D3FD48111', 'IsVersion':'false'}]";
byte[] bytes = ASCIIEncoding.ASCII.GetBytes(body);
request.ContentLength = bytes.Length;
Stream stream = request.GetRequestStream();
stream.Write(bytes, 0, bytes.Length);
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string responseBody = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
body = reader.ReadToEnd();
}
Response.ContentType = "application/json";
Response.Write(body);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The request Body
$body = "[{'FileGUID': '3E55863E74464285AB8C31CFD57AEE17', 'IsVersion':'false'},
{'FileGUID': '67B3BB9ED7184EDFAF42D2B16B756043', 'IsVersion':'false'}]";
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: DownloadLinks',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566'
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "POST",
//The request body
CURLOPT_POSTFIELDS => ($body)
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers = get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Parameter Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "RequestColdFilesDownload" | string |
VersionNumberoptional | Files version number. default is "-1" | int |
[
{"FileGUID":string}
]
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
||||||||||||||||||||||||||||||||||||||||||
JobID | The requested Job ID |
try
{
//The URL For The API
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "POST";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "RequsetColdFilesDownload");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request Body
string body = "[{'FileGUID':'20365D1DDC7546879026618A5E52B514'},{'FileGUID':'9987C5781D7843F9AB3630E80082D2C3'}"
+",{'FileGUID':'1CC485928E314D91B3A7B7A04F68D85E'},{'FileGUID':'676A97F1A0D34B0B9AAC23EAE6C32EDE'}]";
byte[] bytes = ASCIIEncoding.ASCII.GetBytes(body);
request.ContentLength = bytes.Length;
Stream stream = request.GetRequestStream();
stream.Write(bytes, 0, bytes.Length);
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The Request Content Type
header('Content-Type: application/json');
//The request Body
$body = "[{'FileGUID':'20365D1DDC7546879026618A5E52B514'},{'FileGUID':'9987C5781D7843F9AB3630E80082D2C3'}"
.",{'FileGUID':'1CC485928E314D91B3A7B7A04F68D85E'},{'FileGUID':'676A97F1A0D34B0B9AAC23EAE6C32EDE'}]";
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: RequestColdFilesDownload',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566'
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "POST",
//The request body
CURLOPT_POSTFIELDS => ($body)
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers = get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "CheckColdFilesJob" | string |
JobIDrequired | The JobID of the requested files. | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"jobID":int,
"createDate": File Time UTC,
"status": int
}
Parameter Name | Description | Type | Values | ||||||||||
jobID | Shows the job ID. | int | |||||||||||
createDate | Shows the create date of the job. | long | |||||||||||
status | Shows the status of the job. | int |
|
try
{
//The URL For The API
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "CheckColdFilesRequestedJob");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request JobID Header
request.Headers.Add("JobID", "531");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch(Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: CheckColdFilesJob',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566'
//The Request JobID Header
'JobID: 531'
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "Get",
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers = get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type |
ResellerTokenrequired | The Reseller Token | string |
DeviceGUIDrequired | The GUID of the required Device. | string |
ClientIDrequired | The client ID provided. | string |
ClientSecretrequired | The client secret provided. | string |
Actionrequired | The action name "ColdFilesDownloadLinks" | string |
JobIDrequired | The JobID of the requsted files. | int |
PageIndexrequired | Page index number. | int |
PageLimitrequired | Number of files To Show in each page (max number is 1000) | int |
Headers | Info | ||||||||||||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
{
"IsThereMore": bool,
"NextPageIndex": int,
"Files": {
"UploadDate": DateTime (UTC),
"FileFullPath":string (base64),
"FileName":string (base64),
"FileSize": long,
"FileGUID": string,
"FileDownloadURL": string
}
}
Parameter Name | Description | Type |
IsThereMore | Shows that is there more files on the next page or not | bool |
NextPageIndex | Shows From which file index the next page will start | int |
FileFullPath | Shows the Full Path of the file (base64). | string |
FileSize | Shows the size of the file by bytes. | int |
UploadDate | Shows the file upload date. (UTC) | long |
FileGUID | Shows the file GUID. | string |
FileDownloadURL | Shows the Download link for the file. | string |
try
{
//The URL For The API
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "ColdFilesDownloadLinks");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request JobID Header
request.Headers.Add("JobID", "531");
//The Request DeviceGUID Header
request.Headers.Add("PageIndex", "0");
//The Request DeviceGUID Header
request.Headers.Add("PageLimit", "10");
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
string responseBody = string.Empty;
//Read the response body
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
responseBody = reader.ReadToEnd();
}
Response.ContentType = "application/json";
Response.Write(responseBody);
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch (Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: ColdFilesDownloadLinks',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566'
//The Request JobID Header
'JobID: 531'
//The Request PageIndex Header
'PageIndex: 0'
//The Request PageLimit Header
'PageLimit: 10'
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "Get",
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Getting the body from the response.
$body = substr($response, $headerSize);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers = get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
// do whatever you want with the body
echo $body;
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>
Header Name | Description | Type | |
ResellerTokenrequired | The Reseller Token | string | |
DeviceGUIDrequired | The GUID of the required Device. | string | |
ClientIDrequired | The client ID provided. | string | |
ClientSecretrequired | The client secret provided. | string | |
Actionrequired | The action name "CreateFolder" | string | |
FullPathrequired | The full path that will be created, that will created all folders containing in path if not exists. (base64) | string | |
CreationDaterequired | The Creation date time. This header is not required in case the device is a cloud drive device this will be set to current time. |
string | |
ModificationDaterequired | The Modification date time. | string |
Headers | Info | ||||||||||||||||||||||||||||||||||||||
ErrorCode |
|
||||||||||||||||||||||||||||||||||||||
ErrorMessage |
|
try
{
//The URL For The API
string requestURL = "http://intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx";
WebRequest request = WebRequest.Create(requestURL);
//The Request Method
request.Method = "GET";
//The Request Content Type
request.ContentType = "application/x-www-form-urlencoded";
//The Request ResellerToken Header
request.Headers.Add("ResellerToken", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientID Header
request.Headers.Add("ClientID", "ABD0FD32F8FC4D88A86D863BE1D71E56");
//The Request ClientSecret Header
request.Headers.Add("ClientSecret", "c132d5d700e511e8af3d0a213727c326");
//The Request Action Header
request.Headers.Add("Action", "CreateFolder");
//The Request DeviceGUID Header
request.Headers.Add("DeviceGUID", "6f8cb1f9ca0711e783490afc49057566");
//The Request FullPath Header
request.Headers.Add("FullPath", Convert.ToBase64String(Encoding.UTF8.GetBytes("c/users/user"))));
//The Request ModificationDate Header
request.Headers.Add("ModificationDate", DateTime.Now.ToFileTimeUtc().ToString());
//The Request CreationDate Header
request.Headers.Add("CreationDate", DateTime.Now.ToFileTimeUtc().ToString());
WebResponse response = request.GetResponse();
//check the error code to see if there is any errors in the request
if (response.Headers["ErrorCode"] == "0")
{
// The Request Succeeded.
}
else
{
// There is an error check the Error Code and Error Message
Response.Write("Error Code = " + response.Headers["ErrorCode"] + " , Error Message = " + response.Headers["ErrorMessage"]);
}
}
catch (Exception ex)
{
throw ex;
}
<\?php
function Request()
{
try{
//The URL of the API
$url='intellitest.zoolz.com/Services/Public_API/PublicAPIs.ashx';
//The headers array
$headers = array(
'Accept: application/json',
//The Request ClientID Header
'ClientID:ABD0FD32F8FC4D88A86D863BE1D71E56',
//The Request ClientSecret Header
'ClientSecret: c132d5d700e511e8af3d0a213727c326',
//The Request Action Header
'Action: CreateFolder',
//The Request DeviceGUID Header
'DeviceGUID: 6f8cb1f9ca0711e783490afc49057566'
//The Request FullPath Header
'FullPath:'.base64_encode($FullPath),
//The Request ModificationDate Header
'ModificationDate : 131821716783898722',
//The Request CreationDate Header
'CreationDate : 131821716783898722'
);
$request = array(
//Set CURLOPT_POST to 1 will make the request use a "Content-Type: application/x-www-form-urlencoded" header.
CURLOPT_POST => 1,
//Set CURLOPT_HEADER to 1 to include the headers with the body in the response.
CURLOPT_HEADER =>1,
//Set the URL of the API.
CURLOPT_URL => $url,
//set CURLOPT_FRESH_CONNECT to 1 will force a new connection to be used.
CURLOPT_FRESH_CONNECT => 1,
//Set CURLOPT_RETURNTRANSFER to true to return the raw output of the response.
CURLOPT_RETURNTRANSFER =>true,
//Set the request timeout in milliseconds
// CURLOPT_TIMEOUT => 1000000,
//The request Method
CURLOPT_CUSTOMREQUEST => "Get",
);
$curl_request = curl_init();
//fill curl_request using curl_setopt() function.
curl_setopt($curl_request, CURLOPT_HTTPHEADER,$headers);
curl_setopt_array($curl_request, ($request));
//Send request using curl_exec() function.
$response = curl_exec($curl_request);
//Getting the header size from the response.
$headerSize = curl_getinfo($curl_request, CURLINFO_HEADER_SIZE);
//Closing the Request object.
curl_close($curl_request);
//Getting the headers from the response.
$headers = get_headers_from_curl_response($response);
//checking the header ErrorCode
if($headers["ErrorCode"]==0)
{
//The request is successful.
}
else
{
//There is an error .. Check the ErrorCode and ErrorMessage
echo "ErrorCode : ".$headers["ErrorCode"]." , ErrorMessage : ".$headers["ErrorMessage"];
}
}
catch (Exception $ex)
{
}
}
//get the headers by key and returning an array object of the headers
function get_headers_from_curl_response($response)
{
$headers = array();
$header_text = substr($response, 0, strpos($response, "\r\n\r\n"));
foreach (explode("\r\n", $header_text) as $i => $line)
if ($i === 0)
$headers['http_code'] = $line;
else
{
list ($key, $value) = explode(': ', $line);
$headers[$key] = $value;
}
return $headers;
}
Request();
?>