Does anyone have a payload to unassign an asset from a user, along with setting the verification date? I’m able to pull information from the API for a device but am having trouble updating fields on said asset.
Unless
To unassign the asset you can POST to:
https://{site}.incidentiq.com/api/v1.0/assets/{AssetId}/owner
Payload:
{"OwnerId":null}
We don’t use verifications currently so I haven’t messed with that API myself.
To unassign the asset you can POST to:
https://{site}.incidentiq.com/api/v1.0/assets/{AssetId}/owner
Payload:
{"OwnerId":null}
We don’t use verifications currently so I haven’t messed with that API myself.
Fantastic, this is exactly what I was looking for. Thank you. I’ll do some more probing around for the other asset fields.
One idea is just to have an API change the status of an asset and then have a rule that fires on that change doing everything else for you. Maybe not as clean as going purely through the API but a work around for those (like me) who feel like they’re still figuring out the APIs
payload = json.dumps({
"AssetIds": ["{AssetID 1}","{AssetID 2}","{AssetID 3}"],
"Request": {
"VerifiedByUserId": "{API User ID}",
"IsSuccessful": "true",
"Comments": "Auto-Verification - script"
}
})
# Connection Request
conn.request("POST", "/api/v1.0/assets/bulk/verify", payload, headers)
res = conn.getresponse()
data = res.read()
JSON = json.loads(data.decode("utf-8"))
I’m not sure if this helps you, but this is a snippet of a python script that we use to batch verify assets (it will update the date). It works great!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.