# Request

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.MicrosoftDynamics365/tree/main/Frends.MicrosoftDynamics365.Request>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ClientId : `String`       | <p>Azure AD app registration client ID.</p><p><br>Default: <code>-</code><br>Example: <code>9136e6a2-83e5-46ba-b104-d988a169dc24</code></p>                                                                                                                                                                                                                                                                                 |
| TenantId : `String`       | <p>Azure AD tenant ID.</p><p><br>Default: <code>-</code><br>Example: <code>9136e6a2-83e5-46ba-b104-d988a169dc24</code></p>                                                                                                                                                                                                                                                                                                  |
| 🗝ClientSecret : `String` | <p>App registration client secret.</p><p><br>Default: <code>-</code><br>Example: <code>my\_secret</code></p>                                                                                                                                                                                                                                                                                                                |
| Dynamics365Url : `String` | <p>Dynamics 365 URL.</p><p><br>Default: <code>https\://\[MY\_ORG].crm4.dynamics.com</code><br>Example: <code><https://my-org.crm4.dynamics.com></code></p>                                                                                                                                                                                                                                                                  |
| Method : `Method`         | <p>Dynamics 365 URL.</p><p>Possible values:</p><ul><li><code>GET</code>:</li></ul><p>Dynamics 365 URL.</p><ul><li><code>POST</code>:</li></ul><p>Dynamics 365 URL.</p><ul><li><code>PATCH</code>:</li></ul><p>Dynamics 365 URL.</p><ul><li><code>PUT</code>:</li></ul><p>Dynamics 365 URL.</p><ul><li><code>DELETE</code>:</li></ul><p>Dynamics 365 URL.</p><p><br>Default: <code>0</code><br>Example: <code>GET</code></p> |
| Path : `String`           | <p>Request path for the API call.</p><p><br>Default: <code>-</code><br>Example: <code>accounts accounts({{account\_id}}) accounts?$select=name,revenue accounts?$filter=statecode eq 0</code></p>                                                                                                                                                                                                                           |
| Payload : `String`        | <p>Request payload.</p><p><br>Default: <code>-</code><br>Example: <code>{ "firstname": "John", "lastname": "Doe", "emailaddress1": "<john.doe@example.com>", "telephone1": "123-456-7890" }</code></p>                                                                                                                                                                                                                      |
| {% endtab %}              |                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% tab title="Parameter: Options" %}

| Name                                      | Description                                                                                                                  |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| ApiVersion : `String`                     | <p>Dynamics API version to use.</p><p><br>Default: <code>v9.1</code><br>Example: <code>v9.1 / v9.0 / v8.2 / other</code></p> |
| ThrowExceptionOnErrorResponse : `Boolean` | <p>Throw exception on error response.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>               |
| {% endtab %}                              |                                                                                                                              |

{% tab title="Result: Result" %}

| Name                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Data : `Object`         | <p>Contains the input repeated the specified number of times.<br>Example: <code>{ "@odata.context": "https\://\[domain].dynamics.com/api/data/v9.1/$metadata#accounts", "value": \[ { "@odata.etag": "W/"5089461"", "address1\_composite": "6789 Edwards Ave.\r\nLynnwood, Tennessee 37010\r\nUnited States", "websiteurl": "<http://www.example.com>", "name": "Fabrikam, Inc." }, { "@odata.etag": "W/"5089463"", "address1\_composite": "789 3rd St\r\nSan Francisco, California 94158\r\nUnited States", "websiteurl": "<http://www.example.com>", "name": "Trey Research" } ] }</code></p> |
| Success : `Boolean`     | <p>Indicates whether the call to Dynamics 365 was successful. If the call failed and the task is configured to not throw an exception, this will be false.<br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                    |
| ErrorMessage : `String` | <p>Error message if the call to Dynamics 365 failed and the task is configured to not throw an exception.<br>Example: <code>Something went wrong.</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| {% endtab %}            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0] - 2024-07-08

#### Changed

* Added support for PATCH requests and adjusted how the task handles responses from the Dynamics365 API if they have no content.

### \[1.0.0] - 2024-06-10

#### Changed

* Initial implementation.
  {% endtab %}
  {% endtabs %}
