-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Hi
I'm trying to checkout an Asset to a user, but can't work out the correct procedure.
I have successfully found both the Asset and the User using UserManager.FindAll and AssetManager.FindAll, but am struggling to Checkout the asset to the user.
This is what I have tried...
Asset.CheckoutRequest = new SnipeSharp.Endpoints.EndpointHelpers.AssetCheckoutRequest
{
CheckoutToType = "user", // Is this correct?
AssignedUser = User,
Note = "Auto Checkout via Easy Assist"
};
var x = snipe.AssetManager.Update(Asset);
var y = snipe.AssetManager.Checkout(Asset);
After this, x contains "success", but y is an error...
{[assigned_user, The assigned user field is required when none of assigned asset / assigned location are present.]} {[assigned_asset, The assigned asset field is required when none of assigned user / assigned location are present.]} {[assigned_location, The assigned location field is required when none of assigned user / assigned asset are present.]} {[checkout_to_type, The checkout to type field is required.]}
In the apache logs I can see that the checkout request has been received by the snipeit server, so I'm guessing I'm not preparing the request properly.
I'm also not sure if I should be Updating the asset before checking out
Any help would be appreciated.
Thanks in advance
Mark.