Answers.Body: <p>You can download and install <a href="https://github.com/pradpnayak/campaigngroupapi" rel="nofollow noreferrer">Campaign Group API3</a> extension, this extension should provide Campaign Group api which you can either use as <a href="https://docs.civicrm.org/dev/en/latest/api/v3/chaining/" rel="nofollow noreferrer">chain api</a> in Campaign api or you can use base as Campaign Group api and fetch all details of campaign by doing join on.</p>
  <p>HTH</p>
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-23T11:07:24.377Z
Answers.Text: 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.
Answers.UserDisplayName: Gufran Pathan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-19T16:44:05.353Z
Answers.LastActivityDate: 2020-10-19T16:44:05.353Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>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.</p>
  <p>(Sample result below of a GET for Campaign)</p>
  <pre><code>{
  
  &quot;is_error&quot;: 0,
  &quot;version&quot;: 3,
  &quot;count&quot;: 1,
  &quot;id&quot;: 9,
  &quot;values&quot;: [
      {
          &quot;id&quot;: &quot;9&quot;,
          &quot;name&quot;: &quot;AAA&quot;,
          &quot;title&quot;: &quot;AAA&quot;,
          &quot;start_date&quot;: &quot;2020-10-19 13:35:00&quot;,
          &quot;campaign_type_id&quot;: &quot;5&quot;,
          &quot;is_active&quot;: &quot;1&quot;,
          &quot;created_id&quot;: &quot;202&quot;,
          &quot;created_date&quot;: &quot;2020-10-19 13:36:07&quot;,
          &quot;last_modified_id&quot;: &quot;202&quot;,
          &quot;last_modified_date&quot;: &quot;2020-10-19 13:36:07&quot;
      }
  ]}
  </code></pre>
  
Tags: <api><groups><civicampaign><rest>
Title: Getting Groups Associated with Campaigns using REST API
ThreadText: # Getting Groups Associated with Campaigns using REST API
  
  (Asked by: username_0 on 2020-10-19)
  
  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"
      }
  ]}
  
  **Tags:** api, groups, civicampaign, rest
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-10-19. Score: 1 | Accepted answer
  
  You can download and install [Campaign Group API3](https://github.com/pradpnayak/campaigngroupapi) extension, this extension should provide Campaign Group api which you can either use as [chain api](https://docs.civicrm.org/dev/en/latest/api/v3/chaining/) in Campaign api or you can use base as Campaign Group api and fetch all details of campaign by doing join on.
  
  HTH
  
  Pradeep
  
  > **Comments:**
  > **username_0**: 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.  
  
  ---
  
  