Hi,
I want to access all properties of parent folder using Rest API. Its a secured and I am trying to access it though token but not getting any success.
I am following this: https://developers.arcgis.com/rest/enterprise-administration/server/folder.htm
More info on your API call and error messages would help.
Hi David,
I am using PHP curl to access the API. Below is the code. I am getting accessed denied error. Before reaching out to client, I want to know if this is the right approach ?
if ( !function_exists( "\curl_init" ) )
{
\load_curl();
}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://xxxxx/arcgis/rest/services/OSvC/OSvC_LandUse_Areas/MapServer?f=json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYPEER => 1,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_CAINFO => '/cgi-bin/' . cfg_get((120)) . '.db/certs/ca.pem',
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer ".$token,
"Content-Type: application/json"
)
));
$response = curl_exec($curl);
$error = curl_error( $curl );
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
Hi David,
My ultimate goal is to get all features layer that are in one particular folder. Let me know if there any other way to doing this.
Hi All,
I am able to access the secure folder through browser by manually entering the credentials. But when I try to access it through REST API, I get Invalid Token error.
I am doing the below steps
Hi,I am not sure how u are passing the token but you can try the following
https://xxxxx/arcgis/rest/services/OSvC/?f=json&token=fdnfdasfdsajffsdfa