Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 1.64 KB

organizations.md

File metadata and controls

74 lines (52 loc) · 1.64 KB

Organizations

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:

  • name
  • guid
  • is_active
  • tier
  • tier_family
  • tier_display_name
  • role
  • bsds
  • created
  • modified

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)