Title: API Documentation / errors
Last modified: March 12, 2024

---

# API Documentation / errors

 *  Resolved [clementa83](https://wordpress.org/support/users/clementa83/)
 * (@clementa83)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/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 finePosting : /geodir/v2/events/ (bypassing 
   Oath) works fineI 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,
    -  This topic was modified 2 years, 2 months ago by [clementa83](https://wordpress.org/support/users/clementa83/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [alexrollin](https://wordpress.org/support/users/alexrollin/)
 * (@alexrollin)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/api-documentation-errors/#post-17501507)
 * Hello,
 * 1) Did you try with authentication by adding consumer_key & consumer_secret parameters
   to request url. Ex: &consumer_key=ck_226337xxxxxxx&consumer_secret=cs_68794xxxxxxx
 * 2) To retrieve events with endpoint /geodir/v2/events/ use event_type parameter.
   Ex: event_type=upcoming. event_type should be one of from all, upcoming, ongoing,
   ongoing_upcoming, past, today, tomorrow, next_7_days, next_30_days, this_weekend,
   this_week, this_month, next_month, next_week
 * If you need more help please open a ticket here [https://wpgeodirectory.com/support/](https://wpgeodirectory.com/support/)
 *  Thread Starter [clementa83](https://wordpress.org/support/users/clementa83/)
 * (@clementa83)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/api-documentation-errors/#post-17503317)
 * Hi Alex, thanks for your answer, 
   1)This is the error code when I pass parameters
   as header or params:Response: {“code”:”rest_cannot_create”,”message”:”Sorry, 
   you are not allowed to create posts as this user.”,”data”:{“status”:401}}Although
   I have set it as read/write I read somewhere that request with http couldn’t 
   be passed as parameters or headers. That’s why i initially tried using Oauth 
   lib with passing auth = Oauth {consumer_,consumer:secret}
 *  Plugin Support [alexrollin](https://wordpress.org/support/users/alexrollin/)
 * (@alexrollin)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/api-documentation-errors/#post-17510466)
 * Hello,
 * If you need more help please open a ticket here [https://wpgeodirectory.com/support/](https://wpgeodirectory.com/support/)
    -  This reply was modified 2 years, 1 month ago by [alexrollin](https://wordpress.org/support/users/alexrollin/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘API Documentation / errors’ is closed to new replies.

 * ![](https://ps.w.org/geodirectory/assets/icon-256x256.jpg?rev=2778361)
 * [GeoDirectory - WP Business Directory Plugin and Classified Listings Directory](https://wordpress.org/plugins/geodirectory/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geodirectory/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geodirectory/)
 * [Active Topics](https://wordpress.org/support/plugin/geodirectory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geodirectory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geodirectory/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [request](https://wordpress.org/support/topic-tag/request/)

 * 3 replies
 * 2 participants
 * Last reply from: [alexrollin](https://wordpress.org/support/users/alexrollin/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/api-documentation-errors/#post-17510466)
 * Status: resolved