For all the API calls, first create an object of the SDK class so that you can access the SDK functions.
To create an object of the SDK class, pass the following information to the SDK constructor:
clientKey
- obtained when you created an application in Key ManagementclientSecret
- obtained when you created an application in Key ManagementcallbackUrl
- HTTP callback address where the user can access the application. Your app must specify it exactly as you have entered it in Key Management as it is case sensitive.
$sdk = new Thingspace\Cloud\Sdk(clientKey,clientSecret,callbackUrl);
createVirtualFolder
allows you to create a virtual folder.
Request Parameters
name
– The name of the virtual folder.Code Sample
try {
$response = $sdk->createVirtualFolder($name);
} catch (Exception $e) {
try
{
return $e->getResponse();
}
finally {
if(is_object($e))
{
return $e->getResponse()->getBody()->getContents();
}
else
{
return false;
}
}
}
Example Return Response
{
"name": "string",
"parentPath": "string",
"size": 0,
"immutable": false,
"versionCreated": "string"
}
deleteVirtualFolder
deletes a virtual folder.
Request Parameters
name
– The name of the virtual folder.force
- If set to:Code Sample
try {
$response = $sdk->deleteVirtualFolder($virtualfoldername, $force);
} catch (Exception $e) {
try
{
return $e->getResponse();
}
finally {
if(is_object($e))
{
return $e->getResponse()->getBody()->getContents();
}
else
{
return false;
}
}
}
renameVirtualFolder
allows you to rename a virtual folder.
Request Parameters
src
– The current name of a virtual folder.target
- The new name of a virtual folder.Code Sample
try {
$response = $sdk->renameVirtualFolder($source,$target);
} catch (Exception $e) {
try
{
return $e->getResponse();
}
finally {
if(is_object($e))
{
return $e->getResponse()->getBody()->getContents();
}
else
{
return false;
}
}
}
Example Return Response
{
"name": "string",
"parentPath": "string",
"size": 0,
"immutable": false,
"versionCreated": "string"
}
Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.