I'm pretty stuck and can't find anything about it on the internet. I'm also not sure how to describe the thing i'm looking for, so maybe someone can help me.
I've got some code to create a ticket in TopDesk through API using invoke-restmethod in PS.
For the request field in TopDesk, I need some output stored in a variable, but if I want to use a variable in the PS command, I need to define the JSON body with the use of @{} | covertTo-JSON
(found that somewhere on the internet).
Now this parameter I need to put through, has to have a definition. I need to give in in the value is a email or a name.
$json = @{
"callerLookup" = "{ email : email@domain.com }"
} | Convertto-JSON
Now the thing is, TopDesk doesn't see the "{ email : email@domain.com }"
as a correct value.
Before, I just the following (which will work, but can't use variables):
$body = '{"email": "automation@rid-utrecht.nl"}'
I hope I described my problem cleary enough and hope that someone can help me.
Thanks in advance.
Kind regards,
Damian