Answers.Body: <p>OK, I got it! I had to think backwards:</p>
  
  <pre><code>$result = civicrm_api3('ContactType', 'get', array(
    'sequential' =&gt; 1,
    'name' =&gt; "Organization",
    'api.ContactType.create' =&gt; array('label' =&gt; "Entity", 'id' =&gt; "\$value.id"),
  ));
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-23T11:32:12.580Z
Answers.Text: glad you figured it out!
Answers.UserDisplayName: Andrei
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-23T11:27:55.617Z
Answers.LastActivityDate: 2016-06-23T11:27:55.617Z
Answers.UserDisplayName: ñull
Body: <p>I try to relabel Organization as "Entity": </p>
  
  <pre><code>$result = civicrm_api3('ContactType', 'create', array(
    'label' =&gt; "Entity",
    'api.ContactType.get' =&gt; array('name' =&gt; "Organization"),
  ));
  </code></pre>
  
  <p>This errors out with </p>
  
  <blockquote>
    <p>Mandatory key(s) missing from params array: name, parent_id</p>
  </blockquote>
  
  <p>Apparently I don't understand chaining and the required 'id' for updating is not returned. What is wrong in my reasoning?</p>
  
Tags: <api><contact-types><chaining>
Title: How to update ContentType Label through API chaining?
ThreadText: # How to update ContentType Label through API chaining?
  
  (Asked by: username_0 on 2016-06-23)
  
  I try to relabel Organization as "Entity":
  
  ```
  $result = civicrm_api3('ContactType', 'create', array(
    'label' => "Entity",
    'api.ContactType.get' => array('name' => "Organization"),
  ));
  
  ```
  
  This errors out with
  
  > Mandatory key(s) missing from params array: name, parent\_id
  
  Apparently I don't understand chaining and the required 'id' for updating is not returned. What is wrong in my reasoning?
  
  **Tags:** api, contact-types, chaining
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-06-23. Score: 1
  
  OK, I got it! I had to think backwards:
  
  ```
  $result = civicrm_api3('ContactType', 'get', array(
    'sequential' => 1,
    'name' => "Organization",
    'api.ContactType.create' => array('label' => "Entity", 'id' => "\$value.id"),
  ));
  
  ```
  
  > **Comments:**
  > **username_1**: glad you figured it out!  
  
  ---
  
  