Method: Bitly::API::Bitlink.list

Defined in:
lib/bitly/api/bitlink.rb

.list(client:, group_guid:, size: nil, page: nil, keyword: nil, query: nil, created_before: nil, created_after: nil, modified_after: nil, archived: nil, deeplinks: nil, domain_deeplinks: nil, campaign_guid: nil, channel_guid: nil, custom_bitlink: nil, tags: nil, encoding_login: nil) ⇒ Bitly::API::Bitlink::PaginatedList

Retrieve a list of bitlinks by group [‘GET /v4/groups/group_guid/bitlinks`](dev.bitly.com/v4/#operation/getBitlinksByGroup)

Examples:

bitlinks = Bitly::API::Bitlink.list(client: client, group_guid: guid)

Parameters:

  • client (Bitly::API::Client)

    An authorized API client

  • group_guid (String)

    The group guid for which you want bitlinks

  • size (Integer) (defaults to: nil)

    The number of Bitlinks to return, max 100

  • page (Integer) (defaults to: nil)

    The page of bitlinks to request

  • keyword (String) (defaults to: nil)

    Custom keyword to filter on history entries

  • query (String) (defaults to: nil)

    A value to search for Bitlinks

  • created_before (Integer) (defaults to: nil)

    Timestamp as an integer unix epoch

  • created_after (Integer) (defaults to: nil)

    Timestamp as an integer unix epoch

  • modified_after (Integer) (defaults to: nil)

    Timestamp as an integer unix epoch

  • archived (String) (defaults to: nil)

    Whether or not to include archived Bitlinks. One of “on”, “off” or “both”. Defaults to “off”.

  • deeplinks (String) (defaults to: nil)

    Filter to only Bitlinks that contain deeplinks. One of “on”, “off” or “both”. Defaults to “both”.

  • domain_deeplinks (String) (defaults to: nil)

    Filter to only Bitlinks that contain deeplinks configured with a custom domain. One of “on”, “off” or “both”. Defaults to “both”.

  • campaign_guid (String) (defaults to: nil)

    Filter to return only links for the given campaign GUID, can be provided

  • channel_guid (String) (defaults to: nil)

    Filter to return only links for the given channel GUID, can be provided, overrides all other parameters

  • custom_bitlink (String) (defaults to: nil)

    Filter to return only custom Bitlinks. One of “on”, “off” or “both”. Defaults to “both”.

  • tags (Array<String>) (defaults to: nil)

    Filter by the given tags.

  • encoding_login (Array<String>) (defaults to: nil)

    Filter by the login of the authenticated user that created the Bitlink.

Returns:



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/bitly/api/bitlink.rb', line 150

def self.list(
  client:,
  group_guid:,
  size: nil,
  page: nil,
  keyword: nil,
  query: nil,
  created_before: nil,
  created_after: nil,
  modified_after: nil,
  archived: nil,
  deeplinks: nil,
  domain_deeplinks: nil,
  campaign_guid: nil,
  channel_guid: nil,
  custom_bitlink: nil,
  tags: nil,
  encoding_login: nil
)
  params = {
    "size" => size,
    "page" => page,
    "keyword" => keyword,
    "query" => query,
    "created_before" => created_before,
    "created_after" => created_after,
    "modified_after" => modified_after,
    "archived" => archived,
    "deeplinks" => deeplinks,
    "domain_deeplinks" => domain_deeplinks,
    "campaign_guid" => campaign_guid,
    "channel_guid" => channel_guid,
    "custom_bitlink" => custom_bitlink,
    "tags" => tags,
    "encoding_login" => 
  }
  response = client.request(path: "/groups/#{group_guid}/bitlinks", params: params)
  bitlinks = response.body["links"].map do |link|
    new(data: link, client: client)
  end
  PaginatedList.new(items: bitlinks, response: response, client: client)
end