$sitesRequest = new Sites(); $usersRequest = new Users(); // ------------------------- REQUESTS --------------------------- // DOCUMENTS echo $docRequest->deleteDoc('7a6a7f74-3b82-e511-bf04-008cfa482110'); echo $docRequest->getDoc('name%20eq%20%27test%20-2%20-%20test%27'); echo $docRequest->getDocId('e10f2106-8c72-e511-befe-98991b71acc0'); echo $docRequest->getDocIdRev('3c7168e7-4b82-e511-bf04-008cfa482110'); echo $docRequest->getDocIdRevId('e10f2106-8c72-e511-befe-98991b71acc0', 'b5d82c06-8c72-e511-befe-98991b71acc0'); echo $docRequest->getDocIndexFields('3c7168e7-4b82-e511-bf04-008cfa482110'); echo $docRequest->getDocIndexFieldsId('3c7168e7-4b82-e511-bf04-008cfa482110', '6684bdbe-4f82-e511-bf04-008cfa482110'); echo $docRequest->getDocRevIndexFields('3c7168e7-4b82-e511-bf04-008cfa482110', '8767a182-5282-e511-bf04-008cfa482110'); echo $docRequest->getDocRevIndexFieldsId('3c7168e7-4b82-e511-bf04-008cfa482110', '8767a182-5282-e511-bf04-008cfa482110', '6684bdbe-4f82-e511-bf04-008cfa482110'); echo $docRequest->putDocIndexFieldsId('3c7168e7-4b82-e511-bf04-008cfa482110', '9112ae85-b481-e511-bf03-008cfa482110', 'pizzas'); echo $docRequest->putDocIndexFields('3c7168e7-4b82-e511-bf04-008cfa482110', "{\"cool index field\":\"change you\",\"favorite foods\":\"mountain dew\"}"); echo $docRequest->postDoc('10000000-1000-2000-1111-100000000010', 1, 'file54.txt', 'a test file', 'file53.txt', '{}'); // EMAILS echo $emailRequest->postEmails('example@gmail.com,example2@gmail.com', '', 'php email subject', 'this was sent from php. this is the body.'); // FILES $filesRequest->getFile('6db0b14a-a781-e511-bf03-008cfa482110', '/home/jr/Desktop/hello2.txt'); $filesRequest->postFile('/home/jr/Desktop/hello2.txt', 'text/plain', 'helloWorld2.txt', '3c7168e7-4b82-e511-bf04-008cfa482110', 'GEN-15', '5', 'Released', "{\"index field label\":\"the value\"}"); // FOLDERS echo $foldersRequest->getFolder('test%20folder'); echo $foldersRequest->getFolderId('10000000-1000-2000-1111-100000000010'); echo $foldersRequest->getSubFolders('10000000-1000-2000-1111-100000000010'); echo $foldersRequest->getFolderDocs('10000000-1000-2000-1111-100000000010'); echo $foldersRequest->getFolderIndexFields('40ac2b37-9a72-e511-befe-98991b71acc0'); echo $foldersRequest->getFolderIndexFieldsId('40ac2b37-9a72-e511-befe-98991b71acc0', '9febe65a-6d82-e511-bf04-008cfa482110'); echo $foldersRequest->getSelectOptions('40ac2b37-9a72-e511-befe-98991b71acc0', '9febe65a-6d82-e511-bf04-008cfa482110'); echo $foldersRequest->postFolder('folder3', 'folder description', true); echo $foldersRequest->postSubFolder('52fdb979-7282-e511-bf04-008cfa482110', 'folder4', 'folder description', true);
$indexFieldsRequest = new IndexFields(); $metaRequest = new Meta(); $parseRequest = new Parse(); $pdataRequest = new PersistedData(); $sitesRequest = new Sites(); $usersRequest = new Users(); // PARSE RESPONSE // parseResponse() (single field value returned) // for the parseResponse method a single field value is returned requested by the field name. // lets pass in a method to create a folder and store the response as $a. $a = $foldersRequest->postFolder('folder3', 'folder description', true); // now we pass in the response to the parseRequest method and request the folderId and store it as $b. $b = $parseRequest->parseResponse($a, 'id'); // now we have the folderId. we can display it or pass it into another method. // lets create a document and pass in the folderId $b. echo $docRequest->postDoc($b, 1, 'phpParseFile', 'a test file', 'parse.txt', '{}'); // parseListResponse() (list of field values returned) // for the parseListResponse method an array is returned. // we write a sample function here to display the results. function echoList($array, $itemCount) { for ($i = 0; $i < $itemCount; $i++) { echo $array[$i] . "\n"; } } // now the getUsers() method is called and the response is stored as a variable $c. $c = $usersRequest->getUsers(); // now we pass in the response from the getUsers() call and request a list of 10 userId's // stored as an array $d. $d = $parseRequest->parseListResponse($c, 'name', '10'); // now we call echoList to display the users in the array returned by parseListResponse().