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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • API (group_contact,add) does not exist
Pages: [1]

Author Topic: API (group_contact,add) does not exist  (Read 665 times)

hitfactory

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.4.1
  • CMS version: Drupal
  • MySQL version: 5.1.50
  • PHP version: 5.3.3
API (group_contact,add) does not exist
February 25, 2015, 01:21:38 pm
According to the docs, you can add a contact to group using the REST API

http://wiki.civicrm.org/confluence/display/CRMDOC44/REST+interface#RESTinterface-AddusertoGroup

However when I make a request like so, the response indicates no such method exists.

http://example.com/sites/all/modules/civicrm/extern/rest.php?entity=group_contact&action=add&contact_id=1&group_id=1&key=FOO&api_key=BAR

Response:

<?xml version="1.0" ?>
<ResultSetxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Result>
<is_error>1</is_error>
<error_message>API (group_contact,add) does not exist (join the API team and implement it!)</error_message>
</Result>
</ResultSet>









JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: API (group_contact,add) does not exist
February 25, 2015, 01:40:13 pm
The entity should be "GroupContact" rather than "group_contact".  If you want to check syntax, use the API explorer at http://yoursite/civicrm/api/explorer.

That URL is going to vary based on your CMS and whether you have Drupal Clean URLs enabled, but you should be able to work it out!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: API (group_contact,add) does not exist
February 25, 2015, 01:49:00 pm
oh - and it's "create", not "add".
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

hitfactory

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.4.1
  • CMS version: Drupal
  • MySQL version: 5.1.50
  • PHP version: 5.3.3
Re: API (group_contact,add) does not exist
February 25, 2015, 03:17:38 pm
Thank you, JonGold!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • API (group_contact,add) does not exist

This forum was archived on 2017-11-26.