title: how to execute crm book action via web api?
body: <p>CRM exposes <a href="https://msdn.microsoft.com/en-us/library/mt607600.aspx" rel="nofollow noreferrer">actions</a>, and it allows you to execute them via Web API. </p>
  
  <p>For example the following is the <code>WinOpportunity</code> action schema and API:</p>
  
  <pre><code>&lt;Action Name="WinOpportunity"&gt;
    &lt;Parameter Name="OpportunityClose" Type="mscrm.opportunityclose" Nullable="false" /&gt;
    &lt;Parameter Name="Status" Type="Edm.Int32" Nullable="false" /&gt;
  &lt;/Action&gt;
  </code></pre>
  
  <p>And to execute this question, you would POST the following:</p>
  
  <pre><code>POST [Organization URI]/api/data/v8.2/WinOpportunity HTTP/1.1
  Accept: application/json
  Content-Type: application/json; charset=utf-8
  OData-MaxVersion: 4.0
  OData-Version: 4.0
  
  {
   "Status": 3,
   "OpportunityClose": {
    "subject": "Won Opportunity",
    "opportunityid@odata.bind": "[Organization URI]/api/data/v8.2/opportunities(b3828ac8-917a-e511-80d2-00155d2a68d2)"
   }
  }
  </code></pre>
  
  <p><em>Is there a way to execute the BookRequest Action?</em></p>
  
  <p>In examining the CSDL schema, I found that this action is defined as:</p>
  
  <pre><code>&lt;Action Name="Book"&gt;
  &lt;Parameter Name="Target" Type="mscrm.crmbaseentity" Nullable="false"/&gt;
  &lt;Parameter Name="ReturnNotifications" Type="Edm.Boolean"/&gt;
  &lt;ReturnType Type="mscrm.BookResponse" Nullable="false"/&gt;
  &lt;/Action&gt;
  </code></pre>
  
  <p><strong>What will the request look like for this Book action?</strong></p>