Similar to vTiger web services: Permission to perform the operation is denied for query
I'm trying to query vTiger, but I'm using httpful so here's my code:
// vTiger: GET Query
// http://vtiger_url/webservice.php?operation=query&sessionName=[session id]&query=[query string]
$query = "SELECT * FROM Surveys;";
$uri = $vTiger_uri . "?operation=query&sessionName=" . $sessionName . "&query=" . $query;
$response_j = \Httpful\Request::get($uri)->send();
$response = json_decode($response_j, true);
echo "<p>Query: " . $query . "</p>";
echo "<pre>";
print_r($response);
echo "</pre>";
And I get this back:
Array
(
[success] =>
[error] => Array
(
[code] => ACCESS_DENIED
[message] => Permission to perform the operation is denied for query
)
)
I fear I'm missing something very simple, but having checked answers that refer to Zend and Curl I just can't puzzle out why it doesn't work with httpful, something to do with encoding the query string? :-(
Silly me I kept seeing 'don't encode'... but in this way of doing I find I need to, so code becomes:
$query = urlencode("SELECT * FROM Surveys;");
and all well ;-)
Sorry for the bandwidth, but hopefully helpful for others!
Rupert
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.