Answers.Body: <p>Membership doesn't have a contact details(apart from <code>id</code>) in its API call. To get the address and display name, I think you need to call a chain API -</p>
  
  <pre><code>$result = civicrm_api3('Membership', 'get', array(
    'sequential' =&gt; 1,
    'api.Contact.get' =&gt; array('return' =&gt; "display_name, street_address"),
  ));
  </code></pre>
  
  <p>More about chaining - <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Chaining" rel="noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Chaining</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-04T12:02:09.443Z
Answers.Text: Ah, I see now... Thanks... That API needs work...
Answers.UserDisplayName: Serge
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-04T06:42:35.393Z
Answers.LastActivityDate: 2017-06-04T06:42:35.393Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>Not much doc on API and joined table fields... Any special reason I can't get the contact's primary address in a membership query... Basically this</p>
  
  <pre><code>$result = civicrm_api3('Membership', 'get', array(
    'debug' =&gt; 1,
    'sequential' =&gt; 1,
    'return' =&gt; array("contact_id.display_name", "contact_id.street_address"),
  ));
  </code></pre>
  
  <p>Only returns contact_id.display_name</p>
  
Tags: <api>
Title: The apiv3 does not return joined fields
ThreadText: # The apiv3 does not return joined fields
  
  (Asked by: username_0 on 2017-06-04)
  
  Not much doc on API and joined table fields... Any special reason I can't get the contact's primary address in a membership query... Basically this
  
  ```
  $result = civicrm_api3('Membership', 'get', array(
    'debug' => 1,
    'sequential' => 1,
    'return' => array("contact_id.display_name", "contact_id.street_address"),
  ));
  
  ```
  
  Only returns contact\_id.display\_name
  
  **Tags:** api
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-04. Score: 4 | Accepted answer
  
  Membership doesn't have a contact details(apart from `id`) in its API call. To get the address and display name, I think you need to call a chain API -
  
  ```
  $result = civicrm_api3('Membership', 'get', array(
    'sequential' => 1,
    'api.Contact.get' => array('return' => "display_name, street_address"),
  ));
  
  ```
  
  More about chaining - <https://wiki.civicrm.org/confluence/display/CRMDOC/Chaining>
  
  > **Comments:**
  > **username_0**: Ah, I see now... Thanks... That API needs work...  
  
  ---
  
  