Hi, i've read through the documentation for using the API and reading data is no problem, when i try and send something back is when i run into problems.
The documentation gives an example for POSTing data using PHP but i'm not a PHP expert and would preferably be doing this through cURL or PowerShell, but i'm having trouble authenticating with either a specified username:password or the encrypted API key using the phpAES tool.
Can you give any examples of using POST with the API key from the command line or any other examples i could use?
Thanks
Tested some other ways of trying to POST data but it's still failing and in the system logs it gives an error: [V7.3.5] cause = count(): Parameter must be an array or an object that implements Countable
Thanks for looking into this - i resolved the "countable" error in the api/index.php file but i still can't POST or PUT anything.
The error message i receive now is: error: invalid API query, message: ' ' is not a known object class
System log:
2019-02-08 11:19:29.566 ===== TRACE ===== NEW CONNECTED USER 'admin'
2019-02-08 11:26:56.204 ===== TRACE ===== API : mode=GET user=admin, id=1, profile=1
2019-02-08 11:27:42.281 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
2019-02-08 11:27:42.283 ***** ERROR ***** [V7.3.5] ERROR *****
2019-02-08 11:27:42.283 ***** ERROR ***** [V7.3.5] on file 'C:\xampp\htdocs\api\index.php' at line (231)
2019-02-08 11:27:42.284 ***** ERROR ***** [V7.3.5] cause = count(): Parameter must be an array or an object that implements Countable
2019-02-08 11:27:53.307 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
2019-02-08 11:27:53.308 ***** ERROR ***** [V7.3.5] ERROR *****
2019-02-08 11:27:53.308 ***** ERROR ***** [V7.3.5] on file 'C:\xampp\htdocs\api\index.php' at line (231)
2019-02-08 11:27:53.309 ***** ERROR ***** [V7.3.5] cause = count(): Parameter must be an array or an object that implements Countable
2019-02-08 11:28:51.582 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
2019-02-08 11:28:51.583 ***** ERROR ***** [V7.3.5] ERROR *****
2019-02-08 11:28:51.584 ***** ERROR ***** [V7.3.5] on file 'C:\xampp\htdocs\api\index.php' at line (231)
2019-02-08 11:28:51.584 ***** ERROR ***** [V7.3.5] cause = count(): Parameter must be an array or an object that implements Countable
2019-02-08 11:35:20.502 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
2019-02-08 11:35:20.503 ***** ERROR ***** [V7.3.5] ERROR *****
2019-02-08 11:35:20.504 ***** ERROR ***** [V7.3.5] on file 'C:\xampp\htdocs\api\index.php' at line (231)
2019-02-08 11:35:20.504 ***** ERROR ***** [V7.3.5] cause = count(): Parameter must be an array or an object that implements Countable
2019-02-08 11:43:47.062 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
2019-02-08 11:44:48.395 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
2019-02-08 11:45:05.462 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
2019-02-08 11:45:15.687 ===== TRACE ===== API : mode=POST user=admin, id=1, profile=1
Apache Log:
[Fri Feb 08 10:16:56.924283 2019] [mpm_winnt:notice] [pid 13976:tid 740] AH00456: Apache Lounge VC15 Server built: Jul 11 2018 12:13:24
[Fri Feb 08 10:16:56.924283 2019] [core:notice] [pid 13976:tid 740] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Fri Feb 08 10:16:56.932326 2019] [mpm_winnt:notice] [pid 13976:tid 740] AH00418: Parent: Created child process 4340
[Fri Feb 08 10:16:57.450214 2019] [ssl:warn] [pid 4340:tid 692] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 08 10:16:57.489689 2019] [ssl:warn] [pid 4340:tid 692] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 08 10:16:57.520244 2019] [mpm_winnt:notice] [pid 4340:tid 692] AH00354: Child: Starting 150 worker threads.
[Fri Feb 08 10:20:47.519743 2019] [auth_basic:error] [pid 4340:tid 1960] [client ::1:58597] AH01618: user apidata not found: /api/UpdateID1.php
[Fri Feb 08 10:20:56.788060 2019] [auth_basic:error] [pid 4340:tid 1960] [client ::1:58603] AH01618: user apidata not found: /api/UpdateID1.php
[Fri Feb 08 10:34:41.066854 2019] [auth_basic:error] [pid 4340:tid 1960] [client ::1:58930] AH01618: user ProjeQtOr not found: /api/activity/all
[Fri Feb 08 10:35:04.244502 2019] [auth_basic:error] [pid 4340:tid 1980] [client ::1:58931] AH01618: user ProjeQtOr not found: /api/activity
Thanks, i've fixed that but it didn't make any difference - i still get the error: {"error":"invalid API query", "message":"'data' missing for method POST"}
I've tried passing the data through using every way i know of but it gives the same error every time, clearly something isn't right but i can't work out where or how.
When i try to use cURL with other API's it works fine but when i try and give data using "-d {json data}" the Projeqtor API says the data is missing.
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.