API Documentation / errors
-
Hello, I’m planning to use Geodirectory to build a WP based website to show various events.
I fetch the events from various databases and have a connector to fill up the Geodirectory Events and Places. Everything should work through APIs as the amount of event is not manageable by hand.
I’m encountering multiple problems using the API :
1. The API authentication mechanism isn’t clear to me.
My website is for now http Only due to lack/ unknown domain name so I assume I have to use Oath1.0
This seems to be unable to function properly as when I try a POST request I keep receiving :
“Invalid signature – provided signature does not match.” when using Oauth1.0 (I put consumer key +secret from my GeoDirectory -> Keys menu ).
Error comes from php file : wp-content/plugins/geodirectory/includes/api/class-geodir-rest-authentication.php
And “This user has no rights [..] ” when using Basic Auth.
Beside this problem, if I bypass this check, I can do POST request properly.
2.
About GET Method the endpoint “/geodir/v2/events/” always returns :
“status”:400,”params”:{“event_type”:”event_type is not of type string.”}
Althougth regarding the doc, no parameters is requiered for this endpoint, and even if I provide the “event_type” it is not passed to the node , and error is still here.
Error actually occurs in /wp-includes/rest-api.php which is weird to me.
Getting :geodir/v2/places, works fine
Posting : /geodir/v2/events/ (bypassing Oath) works fine
I allowed my self to post both issues here as issue 2 might also be related to authentication problem.
In both case :
– Happens using python with “requests_oauthlib” or Postman.
– Happens setting ‘Content-type’: ‘application/json’ or not .
I’d be happy to know more about the status of this API as I have pretty extensive work to do with it and would not like to encounter some other problems in the futur
Thanks a lot,
Regards,
- The topic ‘API Documentation / errors’ is closed to new replies.