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) »
  • Issue when try to use API via REST interface on 4.4.5
Pages: [1]

Author Topic: Issue when try to use API via REST interface on 4.4.5  (Read 711 times)

chanunc

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.4.10
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.33
  • PHP version: 5.3.27
Issue when try to use API via REST interface on 4.4.5
April 28, 2014, 06:58:45 am
Hi, there

I have an issue when trying to call API via REST interface on CiviCRM 4.4.5 

The detail of URL request is
Code: [Select]
http://localhost/sites/all/modules/civicrm/extern/rest.php?api_key=1234&key=1ac52f39bc8d5530d14b3eaa1c449ce6&json=1&debug=1&entity=Contact&action=get&id=1
api_key=1234    (set in an admin record in civicrm_contact table)
key=1ac52f39bc8d5530d14b3eaa1c449ce6  (got it from civicrm.settings.php)
json=1
debug=1
entity=Contact
action=get
id=1

Only response I got is
Code: [Select]
{
"error_message":"Unknown function invocation.",
"is_error":1
}

The way of calling API with REST interface came from
http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API#UsingtheAPI-REST
and
http://wiki.civicrm.org/confluence/display/CRMDOC/API+Security

This issue didn't happen with CiviCRM 4.4.4
Please help, thanks

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Issue when try to use API via REST interface on 4.4.5
April 28, 2014, 07:06:36 am
Ehm... Strange your rest call seems to be ok. Could you investigate where the error unknown function invocation is set? And does it go away when you use lowercase entity/action?
Developer at Edeveloper / CiviCoop

chanunc

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.4.10
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.33
  • PHP version: 5.3.27
Re: Issue when try to use API via REST interface on 4.4.5
April 28, 2014, 07:33:15 am
Hi, jaapjansma

Thanks for your reply.
I have tried lowercase on entity/action. It doesn't work either, same response I got.
However, I'm investigating further on where the 'Unknown function invocation.' is set.

I hope this is not related to API changes in
http://wiki.civicrm.org/confluence/display/CRMDOC/API+changes#APIchanges-4.4.5:Addedclient-sideCRM.api3()wrapper
 :-\

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Issue when try to use API via REST interface on 4.4.5
April 28, 2014, 08:25:46 am
The wiki you are referring to is about calling the API from Javascript but you use the REST interface. Does your api call work from the api explorer?
e.g. in your site go to the page index.php?q=civicrm/api/explorer
Developer at Edeveloper / CiviCoop

Fabian_SYSTOPIA

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 3
  • CiviCRM version: 4.3.x, 4.4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.4.10
  • PHP version: 5.4.10
Re: Issue when try to use API via REST interface on 4.4.5
April 28, 2014, 09:20:48 am
You may want to take a look at this issue/fix - could be related:
https://issues.civicrm.org/jira/browse/CRM-14506

Greetings
Fabian

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Issue when try to use API via REST interface on 4.4.5

This forum was archived on 2017-11-26.