<p class=“s14dydj4-10 kiAEUp”>I was able to GET but i am not able to post. See screenshot:</p>
<p class=“s14dydj4-10 kiAEUp”>There is a field called = Last Sign in" where I want to write “Last Sign in API”
However, I want to only add it to the Organization ID 1893961 and Flexible-asset-type-id: 122389</p>
<p class=“s14dydj4-10 kiAEUp”>I am getting some kind of syntax error. This is my first time using APIs: I am following the tutorial here:https://kb.itglue.com/hc/en-us/articles/236404927-Getting-started-with-the-IT-Glue-API</p>
<p class=“s14dydj4-10 kiAEUp”>Screenshot of my code: https://imgur.com/a/zEQyV8I</p>
Never just guess at this. Spend the time getting ramped up on it.
There are many videos on YouTube, MSDN Channel9, and samples on TechNet, MS PowerShellGallery, etc. , to use, tweak, learn from.
A quick search using ‘powershell api post’ , would give you a good list / examples to leverage.
Example(s):
PowerShell REST API Programming
Interact with REST-Based Web APIs
http://powershellcookbook.com/recipe/Vlhv/interact-with-rest-based-web-apis
Powershell script to send POST Requests to API
How To Make REST API Requests in PowerShell
All API’s have their quirks and unless one has access to what you are doing / using, it’s all guessing.
Agreeing to @postanote and @Olaf-Soyk , here is a hint
Construction of $Body has issues. You have to construct json, what is available is a kind of nested Scriptblock (with syntax issues).
Define body as string,
#Example.
$Body = @"
{
"parent" : {
"child" : 1
}
}
"@