CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Different resultset when using REST API and API Explorer
Pages: [1]

Author Topic: Different resultset when using REST API and API Explorer  (Read 1050 times)

capo

  • I post occasionally
  • **
  • Posts: 108
  • Karma: 5
Different resultset when using REST API and API Explorer
August 21, 2013, 01:16:14 am
I'm working with an external company that will need to access a part of my contact database (but not all). In a development environment, they already have a user and it's correspondent API key.

That's what I've done
  • They don't need to access the entire contact database, so their Drupal role has both "CiviCRM: view all contacts" and "CiviCRM: edit all contacts" disabled.
  • I've specified the groups of contacts they can access via ACL's.

Now, if I login with their user, I can only see the correspondent part of the database. If I perform a "global search", I only obtain the contacts they should have permission to see. Everything ok, until here.

The problem
If I go to the API explorer, when I'm logged in with their user, and I ask for all the contacts (Contact / get), I obtain only the contacts of the groups that I'm supposed to see.
But if I make the same call via REST (/sites/all/modules/civicrm/extern/rest.php) I can't see any contact.

Quote
{
   "is_error":0,
   "version":3,
   "count":0,
   "values":[]
}

Shouldn't I obtain the same result set? Any idea?
« Last Edit: August 21, 2013, 01:22:38 am by capo »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Different resultset when using REST API and API Explorer
August 21, 2013, 01:24:21 am
Are you using 4.1? you should upgrade, got a fair bit of code fixing since then
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

capo

  • I post occasionally
  • **
  • Posts: 108
  • Karma: 5
Re: Different resultset when using REST API and API Explorer
August 21, 2013, 02:25:37 am
Quote from: xavier on August 21, 2013, 01:24:21 am
Are you using 4.1? you should upgrade, got a fair bit of code fixing since then

No, no! Sorry, I've to update my profile information. I'm using 4.3.5.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Different resultset when using REST API and API Explorer

This forum was archived on 2017-11-26.