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) »
  • using api to remove contact from group
Pages: [1]

Author Topic: using api to remove contact from group  (Read 853 times)

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
using api to remove contact from group
June 22, 2012, 07:48:30 pm
The most obvious (and only that I could see) option would be:

civicrm_api3_group_contact_delete (line 126)

But the API 3 page says it is deprecated, with no recommendations on what to use instead,

Any suggestions?
You did not answer the verification questions correctly - sigh

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: using api to remove contact from group
June 23, 2012, 12:20:20 am
Use create with a 'status' => 'Removed' (which is what delete does). The reason delete is deprecated is that it implies a full delete but it actually just updates status to 'removed'
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: using api to remove contact from group
June 23, 2012, 12:21:18 am
Oh yeah - you mean

civicrm_api('group_contact','create',$params);

don't you? Ie. don't call the functions in the api folder directly
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: using api to remove contact from group
June 23, 2012, 08:15:34 am
Cheers Eileen, yes I figured out that is how you are meant to call the api, a bit of string manipulation never hurt anyone lol
You did not answer the verification questions correctly - sigh

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: using api to remove contact from group
June 23, 2012, 03:04:15 pm
Hi,

Yes it has, remember that the forum belong to the collective documentation, and you can't imagine how long we end up fighting a typo or old syntax years after it was deemed "not the proper way" :)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: using api to remove contact from group
June 24, 2012, 05:29:45 am
And to make matters worse, we change 'the proper way' every now and then..... ;)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: using api to remove contact from group
July 04, 2012, 01:49:01 pm
Quote from: Erik Hommel on June 24, 2012, 05:29:45 am
And to make matters worse, we change 'the proper way' every now and then..... ;)

Tis the best way, keep people on their toes lol
You did not answer the verification questions correctly - sigh

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • using api to remove contact from group

This forum was archived on 2017-11-26.