CiviCampaign allows you to 'include group(s)' as a part of a Campaign. Is there a way to 'get' which groups have been associated for a given campaign ID using the REST API? The GET API for Campaign doesn't provide this information.

(Sample result below of a GET for Campaign)


"is_error": 0,
"version": 3,
"count": 1,
"id": 9,
"values": [
        "id": "9",
        "name": "AAA",
        "title": "AAA",
        "start_date": "2020-10-19 13:35:00",
        "campaign_type_id": "5",
        "is_active": "1",
        "created_id": "202",
        "created_date": "2020-10-19 13:36:07",
        "last_modified_id": "202",
        "last_modified_date": "2020-10-19 13:36:07"

You can download and install Campaign Group API3 extension, this extension should provide Campaign Group api which you can either use as chain api in Campaign api or you can use base as Campaign Group api and fetch all details of campaign by doing join on.



  • This works like a charm, thank you so much. Quick question - can you tell me where in the your extension code can I find the logic get the 'group_type: Include'? Sorry I'm not familiar with how extensions are developed. Tried looking at the code but couldn't figure out. Oct 23 '20 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.