-
So i have been trying to import my data into my local instance of Snipe, so far everything has been working successfully but when i try to add an asset i get the following error. Invoke-WebRequest : {"status":"error","messages":{"type":["Status label type is required."]},"payload":null} this is the JSON data set that was created via the API Explorer page which i put in just to verify that my powershell code was creating valid JSON which it does. so i have reviewed the status and the status that i am after is ID 1 and is valid. Snipe-IT version Any idea what the issue might be, also the exact same issue appears if i leave the field status_id out of the JSON object so maybe the field name is wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you show me your curl request? |
Beta Was this translation helpful? Give feedback.
-
So i figured it out, it is the order which the data is stored in the JSON object, the interesting thing was that if i put model_id before status_id it would throw an issue, and if model_id was before asset_tag it would throw an error for model_id. the interesting thing is appear that all 3 need to be in order as they are in the API Documents but you can have archived, depreciate and other fields in front of it but asset_tag, status_id and model_id must go in that exact order, it does not matter where as long as they come one after each other in that order... I don't know if that's by designed but at least i know now.. |
Beta Was this translation helpful? Give feedback.
So i figured it out, it is the order which the data is stored in the JSON object,
i used curl on the Snipe server and tested it, entry at a time and finally got it work with this value
{
"archived": false,
"depreciate": false,
"requestable": false,
"last_audit_date": "null",
"asset_tag": "10981-PS",
"status_id": 1,
"model_id": 302
}
the interesting thing was that if i put model_id before status_id it would throw an issue, and if model_id was before asset_tag it would throw an error for model_id. the interesting thing is appear that all 3 need to be in order as they are in the API Documents but you can have archived, depreciate and other fields in front of it but asset_tag, status_id and m…