CiviCRM Community Forums
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
This topic
This board
Entire forum
Google
News:
CiviCon 2013 Session Videos Coming Soon!
Help improve CiviCRM: Support
Civi-Make-It-Happen
projects.
Learn more about using and extending CiviCRM:
User and Developer Guides
.
What to do if you think you've found a bug
.
Home
Help
Search
Login
Register
CiviCRM Community Forums
»
CiviCRM Community
»
Developer Discussion
»
APIs and Hooks
(Moderator:
Donald Lobo
) »
using api to remove contact from group
« previous
next »
Print
Pages: [
1
]
Author
Topic: using api to remove contact from group (Read 366 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
«
on:
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?
Logged
You did not answer the verification questions correctly - sigh
Eileen
Forum Godess / God
I’m (like) Lobo ;)
Posts: 3235
Karma: 155
Re: using api to remove contact from group
«
Reply #1 on:
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'
Logged
(http://civicrm.org/sites/civicrm.org/files/bugsmithing-2013-03.png)
Eileen
Forum Godess / God
I’m (like) Lobo ;)
Posts: 3235
Karma: 155
Re: using api to remove contact from group
«
Reply #2 on:
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
Logged
(http://civicrm.org/sites/civicrm.org/files/bugsmithing-2013-03.png)
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
«
Reply #3 on:
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
Logged
You did not answer the verification questions correctly - sigh
xavier
Forum Godess / God
I’m (like) Lobo ;)
Posts: 3729
Karma: 133
CiviCRM version: yes probably
CMS version: drupal
Re: using api to remove contact from group
«
Reply #4 on:
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"
Logged
-
27-28 March: Developer training in Gent/Belgium
Erik Hommel
Forum Godess / God
I live on this forum
Posts: 1255
Karma: 44
CiviCRM version: from 3.3.5 to 4.3
CMS version: Drupal 6.20 and Drupal 7
MySQL version: 5.5.29-0ubuntu0.12.10.1
PHP version: PHP 5.3.10-1ubuntu3 with Suhosin-Patch (cli)
Re: using api to remove contact from group
«
Reply #5 on:
June 24, 2012, 05:29:45 am »
And to make matters worse, we change 'the proper way' every now and then.....
Logged
Make sure you check the latest Make It Happen initiatives!
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
«
Reply #6 on:
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
Logged
You did not answer the verification questions correctly - sigh
Print
Pages: [
1
]
« previous
next »
CiviCRM Community Forums
»
CiviCRM Community
»
Developer Discussion
»
APIs and Hooks
(Moderator:
Donald Lobo
) »
using api to remove contact from group