Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octokit::EnterpriseAdminClient create_organization method #719

Closed
veesa opened this issue Feb 8, 2016 · 3 comments
Closed

Octokit::EnterpriseAdminClient create_organization method #719

veesa opened this issue Feb 8, 2016 · 3 comments

Comments

@veesa
Copy link

veesa commented Feb 8, 2016

I am trying to programmatically create some Organizations.

In the code I have:

admin_client.create_organization('<loginname>', 'false', {:name=>'Research'})

When executed it gives me:

POST https://172.16.165.25.xip.io/api/v3/admin/organizations: 422 - Invalid request. (Octokit::UnprocessableEntity)

"admin", "login" weren't supplied. // See: https://developer.github.com/enterprise/2.4/v3/enterprise/organizations/

What are the values of "admin" and "login" that I need to supply in order to get this method working? The supplied URL (https://developer.github.com/enterprise/2.4/v3/enterprise/organizations/) returns a 404.

Cheers!

@gjtorikian
Copy link
Member

So sorry about the incorrect URL. I'll file an issue internally to get that resolved.

In the meantime, the actual documentation URL is https://developer.github.com/enterprise/2.4/v3/enterprise/orgs/. Does reading about the endpoint there help you out?

@keeran
Copy link

keeran commented Feb 17, 2016

This is due to the gem release having an incomplete create_organization method:

def create_organization(login, admin, options = {})
  post "admin/organizations", options
end

The login and admin args are ignored. This is not the case on master.

The workaround is to duplicate the fields in the options arg:

admin_client.create_organization 'dummy', 'params', { :login => 'new-org-name', :admin => 'ghe-admin', :profile_name => 'new org!'}

@kytrinyx
Copy link
Contributor

kytrinyx commented Jul 6, 2017

I'm going to go ahead and close this, since there have been new releases since the issue was opened, which would have fixed the create_organization method.

@kytrinyx kytrinyx closed this as completed Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants