barrycarey / SnipeSharp

A c# wrapper for the Snipe IT API
25 stars 30 forks source link

Create User not working (no errors?) #26

Closed SuperStark closed 1 year ago

SuperStark commented 1 year ago

Is this still maintained at all, just tried this to create a user, but it does nothing (getting data all works fine)

Code in VB.net:

Dim User As User = New User() With { .Firstname = Option_FirstName, .Lastname = Option_LastName, .Username = Option_SelectedEmail, .Email = Option_SelectedEmail, .Company = SnipeItApi.CompanyManager.Get("Some Company Ltd"), .Location = SnipeItApi.LocationManager.Get(Option_SelectedOffice & " Office"), .Password = "HelloHello1", .Activated = True } SnipeItApi.UserManager.Create(User)

SuperStark commented 1 year ago

For anyone with the same issue, after debugging it looks like the API wants a password confirmation Added this as a RequiredRequestHeader, works fine now.