Class: Amocrm::Resources::ShortLinks

Inherits:
Object
  • Object
show all
Defined in:
lib/amocrm/resources/short_links.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ShortLinks

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ShortLinks.

Parameters:



30
31
32
# File 'lib/amocrm/resources/short_links.rb', line 30

def initialize(client:)
  @client = client
end

Instance Method Details

#create(url:, request_options: {}) ⇒ Amocrm::Models::ShortLinkCreateResponse::ShortLinkCreateResponse, Amocrm::Models::ShortLinkCreateResponse::Problem

Create short link.



16
17
18
19
20
21
22
23
24
25
# File 'lib/amocrm/resources/short_links.rb', line 16

def create(params)
  parsed, options = Amocrm::ShortLinkCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v4/short_links",
    body: parsed,
    model: Amocrm::Models::ShortLinkCreateResponse,
    options: options
  )
end