2

I am trying to write an external app with python, that should make a call to the CiviCRM's APIv4 to get a list of contacts & relationships.

I am using CiviCRM's with Wordpress and debian 11.

Wordpress is installed under /var/www/wordpress

I am having problems to find the correct base URL to make calls to the APIv4.

I got it working with v3 using http://192.168.100.168:8166/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Relationship&key={site_key}&json=1&debug=1&version=3&api_key={myApiKey}&action=get

If I try, like is said in the docs, to call http://192.168.100.168:8166/civicrm/ajax/api4/Relationship/get I get a 404 NotFound error.

Thats what I see in the REST tab in API Explorer 4

enter image description here

How should I call the APIv4?

1 Answer 1

2

How about http://192.168.100.168:8166/?civiwp=CiviCRM&q=civicrm/ajax/api4/Relationship/get

You can check the REST tab in API4 explorer for correct url

2
  • Your URL didn't work. Please see my updated question, with an image of the REST tab,
    – Rafa Gomez
    Oct 14, 2022 at 22:47
  • Updated the url Oct 15, 2022 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.