Method: Bitly::API::Bitlink.expand

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

.expand(client:, bitlink:) ⇒ Bitly::API::Bitlink

Return public information about a bitlink [‘POST /v4/expand`](dev.bitly.com/v4/#operation/expandBitlink)

Examples:

bitlink = Bitly::API::Bitlink.expand(client: client, bitlink: "bit.ly/example")

Parameters:

  • client (Bitly::API::Client)

    An authorized API client

  • bitlink (String)

    The bitlink you want information about

Returns:



110
111
112
113
114
# File 'lib/bitly/api/bitlink.rb', line 110

def self.expand(client:, bitlink:)
  bitlink = Utils.normalise_bitlink(bitlink: bitlink)
  response = client.request(path: "/expand", method: "POST", params: { "bitlink_id" => bitlink })
  new(data: response.body, client: client, response: response)
end