First, thank you for your excellent work on the API. It's a very interesting functionnality.
Two point :
- Question : is it necessary too encrypt message (with AES-256) if i call the web service using https ? I try too call the web service using microsoft WinHttpRequest. and i have lot of problem with encryption.
- Propose Evolution : add a service for search elements with criteria. Sample : if i want know if a project named "Project ONE" exist, i can ask this web service with a criteria : '{"name":"Project ONE"}'. This evolution can help, if we want check existence of object before using insert or update WS.
Question : is it necessary too encrypt message (with AES-256) if i call the web service using https ? I try too call the web service using microsoft WinHttpRequest. and i have lot of problem with encryption.
Yes, encryption is mandatory. It is a security constraint, not to crypt data, but to confirm you have the correct API Key. Security (to retrive access rights) is in two points :
- you have to connect with correct user/password (means you have an account)
- you provide the correct API key (in fact you don't really provide it, you use it to code data) : this means the admin gave you this API key, and is OK for you to post data through the API.
Propose Evolution : add a service for search elements with criteria. Sample : if i want know if a project named "Project ONE" exist, i can ask this web service with a criteria : '{"name":"Project ONE"}'. This evolution can help, if we want check existence of object before using insert or update WS.
Thank you for your answer.
For the Ticket #1490, if you want i have develop the functionality in a simple way (I have add a case like "filter", but named "search").
If you want you can use the following code:
else if (count($split)==2 and $split[1]=='search') { // =============== uri = {OblectClass}/search
if (isset($_REQUEST['data']) ) {
$data=$_REQUEST['data'];
} else {
$data=file_get_contents("php://input");
}
if (! $data) {
returnError($invalidQuery, "'data' missing for method ".$_SERVER['REQUEST_METHOD']);
}
$dataArray=@json_decode($data,true);
if (! $dataArray) {
returnError($invalidQuery, "'data' is not correctly encoded for method ".$_SERVER['REQUEST_METHOD'].". Request for correct API KEY");
}
if (isset($dataArray['items'])) {
$arrayData=$dataArray['items'];
} else {
$arrayData=array($dataArray);
}
$where="1=1 ";
foreach ($arrayData[0] as $field=>$value) {
$where.="and " . $field . "='" .$value . "' ";
}
}
I have modify my proposed code to add to the search service the capability to use "OR" conditions.
for exemple if you want to get activity close OR canceled, you can send a query like : {"identifier":"id","items":[{"idStatus":"7"},{"idStatus":"9"}]}
else if (count($split)==2 and $split[1]=='search') { // =============== uri = {OblectClass}/search
if (isset($_REQUEST['data']) ) {
$data=$_REQUEST['data'];
} else {
$data=file_get_contents("php://input");
}
if (! $data) {
returnError($invalidQuery, "'data' missing for method ".$_SERVER['REQUEST_METHOD']);
}
$dataArray=@json_decode($data,true);
if (! $dataArray) {
returnError($invalidQuery, "'data' is not correctly encoded for method ".$_SERVER['REQUEST_METHOD'].". Request for correct API KEY");
}
if (isset($dataArray['items'])) {
$arrayData=$dataArray['items'];
} else {
$arrayData=array($dataArray);
}
$where=(count($arrayData))>0?"(1=0 ":"(1=1";
foreach ($arrayData as $arrayFilter) {
$where.="or (1=1 ";
foreach ($arrayFilter as $field=>$value) {
$where.="and " . $field . "='" .$value . "' ";
}
$where.=') ';
}
$where.=') ';
}
En poursuivant votre navigation, vous acceptez le dépôt de cookies tiers destinés au bon fonctionnement et à la sécurisation du site (gestion de session, reCaptcha) et à une analyse statistique anonymisée des accès sur notre site (Google Analytics). Si vous vous inscrivez, les informations que vous fournirez ne seront jamais divulguées à un tiers sous quelque forme que ce soit. En savoir plus
Paramétrages de cookies
×
Cookies fonctionnels
Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.
Session
Veuillez vous connecter pour voir vos activités!
Autres cookies
Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.