REST API v3: How to edit an asset?
I need help forming my JSON for this. The reply message that I get back is simply "Internal Error" without any other identifying output to help track down the issue. I can update Location by itself just fine, but I cannot update the State with the current JSON parameters.
- $id = "111111"
- $input = @"
- {
- "asset": {
- "state": {
- "name": "In Store",
- "id": "1"
- },
- "location": "Test Location"
- }
- }
- "@
- $header = @{TECHNICIAN_KEY=$ApiKey}
- $params = @{input_data=$input;format='json'}
- $Uri = $SdpUri + "/api/v3/assets/$id"
- $result = Invoke-RestMethod -Method PUT -Uri $Uri -Headers $header -Body $params -ContentType "application/x-www-form-urlencoded"
New to ADSelfService Plus?