Organizations
October 23, 2022 ยท View on GitHub
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.
List 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)
Fetch an Organization
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)
Organization attributes
Organizations have the following attributes:
nameguidis_activetiertier_familytier_display_namerolebsdscreatedmodified
Organization groups
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)