An organization is the top level of the Bitly user hierarchy. Both Users and Groups live within an organization.
See the full Bitly API documentation for Organizations.
With an API client you can list the organizations available to the authorized user.
client = Bitly::API::Client.new(token: token)
organizations = client.organizations
Or with the class method:
organizations = Bitly::API::Organization.list(client: client)
If you have the guid of an organization, you can fetch it directly.
client = Bitly::API::Client.new(token: token)
organization = client.organization(guid)
Or with the class method
organization = Bitly::API::Organization.fetch(client: client, organization_guid: guid)
Organizations have the following attributes:
name
guid
is_active
tier
tier_family
tier_display_name
role
bsds
created
modified
With an organization you can fetch its related groups.
client = Bitly::API::Client.new(token: token)
organization = client.organization(guid)
groups = organization.groups
This is the same as fetching groups and filtering by an organization guid.
client = Bitly::API::Client.new(token: token)
organization = client.organization(guid)
groups = client.groups(organization: organization)
Or filtering in the class method directly.
groups = Bitly::API::Group.list(client: client, organization: organization)