Created
May 4, 2012 00:25
-
-
Save danieljpeter/2590661 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getReportFolders($access_token) { | |
| $arrReturn = array(); | |
| $query = "SELECT Id, DeveloperName FROM Folder WHERE Type='Report' AND DeveloperName != ''"; | |
| $url = "https://ssl.salesforce.com/services/data/v20.0/query?q=" . urlencode($query); | |
| $curl = curl_init($url); | |
| curl_setopt($curl, CURLOPT_HEADER, false); | |
| curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
| curl_setopt($curl, CURLOPT_HTTPHEADER, array("Authorization: OAuth $access_token")); | |
| $json_response = curl_exec($curl); | |
| curl_close($curl); | |
| $response = json_decode($json_response, true); | |
| foreach ((array) $response['records'] as $record) { | |
| array_push($arrReturn, $record['DeveloperName']); | |
| } | |
| return $arrReturn; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment