Graph Request
Tag: DoGraphRequest
Graph requests can be launched from Ytria automation.
Their result can be stored in a variable or in a text file.
Tag Attributes
Attributes | Attribute Values | Value Description |
---|---|---|
URL | N/A | Request URL |
UseApp | TRUE / FALSE - Defaults to FALSE (whether to use App session or not, instead of User -- for Elevated/ Role) | N/A |
Name | N/A | Output var name |
FilePath | Output file path (ignored if Name is not empty) | N/A |
HttpHeaders | Optional http headers | semi-colon separated list of Header:Value pairs |
Method | GET, POST, PATCH, PUT, DEL - Defaults to GET | N/A |
JsonBody | request json body (for POST, PATCH, PUT) | N/A |
Example Script
<ytriaAutomation Application="sapio365">
<DoGraphRequest Url="https://graph.microsoft.com/v1.0/users/" Name="myVar"/> <!-- Dump GET request to var -->
<echo value="{%myVar%}"/>
<DoGraphRequest Url="https://graph.microsoft.com/v1.0/users/" FilePath="C:\dump.txt" UseApp="True" HttpHeaders="ConsistencyLevel:Eventual"/> <!-- Dump GET request to file, using app session and optional http headers -->
<!-- Do PATCH request and dump result to var, using app session -->
<DoGraphRequest Url="https://graph.microsoft.com/v1.0/users/2e6e6cf6-d3a3-4746-b4cd-3f2ffea94062" Method="Patch" jsonBody="USE_CDATA" Name="myVar" UseApp="true">
<![CDATA[{"officeLocation": "Montreal"}]]>
</DoGraphRequest>
<echo value="{%myVar%}"/>
</ytriaAutomation>