I tried below steps but I am getting an error in calling rest API via the browser.

  1. I checked which user is an administrator and added api key via phpmyadmin interface.
  2. Get the site key from CiviCRM settings.
  3. I cross checked that user have permissions for editing and view contacts.
  4. I want to get operation for contacts based on some condition.

Please have a look at error that I am getting.enter image description here

Setting file is present in same folder public_html/crm/sites/default

Please help me.It's the little bit urgent. I am very thankful to you.

With Regards,

Mohit Thareja

2 Answers 2


In your pictured error messages, I see sites/all/modules/cv/civicrm which looks a little strange. CiviCRM is typically installed at sites/all/modules/civicrm. I'm not positive this will help, but I would suggest trying the following:

  1. Move the civicrm folder up into the modules folder.
  2. Make sure CiviCRM still works via the regular front-end interface (and troubleshoot, as necessary)
  3. Try your REST call again

I've seen CiviCRM not behave correctly in a couple of other cases, both of which I believe have been addressed in recent releases but still might be worth investigating:

  • Where a symlink existed as part of the site path. (eg, /home4/mark is actually a symlink to /srv/userdata/m/mark, or /home4/mark/public_html/crm is a symlink to /home4/mark/project1/civicrm)
  • Where the CMS/CiviCRM was not installed to the webroot of the site. (This appears to be the case, eg Drupal/CiviCRM is installed at http://example.org/crm/ rather than http://example.org/

If Sean's recommendation doesn't resolve your situation, you might investigate these potential causes as well.

In any case, please do update with the solution you find - it may help that being addressed in CiviCRM core and save you or other users similar challenges in future!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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