bumpkin
bumpkin

Reputation: 3469

gitlab create new user via api yields 404

I'm able to do get requests to the gitlab api but I now want to programmatically create my first user. But every time I do a post request in Ruby:

uri = URI.parse("http://ip-address/api/v3/users")
http = Net::HTTP::new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.set_form_data({"username" => "username", "email" => "[email protected]", "password" => "password", "name" => "name"})
request["PRIVATE-TOKEN"] = "private-token"
response = http.request(request)

It shouldn't make a difference but i've tried this with a standard curl request, and with the gitlab ruby wrapper. For all of them my get requests work, but I get a 404 when trying to create a new user. Any ideas?

Upvotes: 2

Views: 565

Answers (1)

VonC
VonC

Reputation: 1329292

As commented in issue 6878:

404 is the default result so far for

  • password isn't acceptable
  • email isn't unique
  • username isn't unique

So make sure your POST isn't for a user with a password or email or name problem (like one mentioned in issue 4209).

Upvotes: 2

Related Questions