- TOPdesk API Username and Key
- User-defined variables:
topdeskBaseUrl
,topdeskApiUsername
andtopdeskApiSecret
created in your HelloID portal.
This code snippet will archive an incident within TOPdesk and executes the following tasks:
- Define a hash table
$formObject
. The keys of the hash table represent the properties necessary to archive an incident withinTOPdesk
, while the values represent the values entered in the form.
To view an example of the form output, please refer to the JSON code pasted below.
{
"id": "6253ec7d-17ae-416e-925b-8a11897401c5",
"archivingReasonId" : "73736b19-a69e-5e6b-b6af-ddc655fead0c"
}
❗ It is important to note that the names of your form fields might differ. Ensure that the
$formObject
hash table is appropriately adjusted to match your form fields. See the TOPdesk API Docs page
-
Creates authorization headers using the provided API key and secret.
-
Archive an incident using the:
Invoke-RestMethod
cmdlet. The hash table called:$formObject
is passed to the body of the:Invoke-RestMethod
cmdlet as a JSON object.