Class: Amocrm::Resources::UnsortedLeads

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ UnsortedLeads

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 UnsortedLeads.

Parameters:



74
75
76
# File 'lib/amocrm/resources/unsorted_leads.rb', line 74

def initialize(client:)
  @client = client
end

Instance Method Details

#accept(uid, status_id: nil, user_id: nil, request_options: {}) ⇒ Amocrm::Models::UnsortedLeadAcceptResponse::UnsortedAcceptResponse, Amocrm::Models::UnsortedLeadAcceptResponse::Problem

Parameters:

  • uid (String)
  • status_id (Integer)

    Status id for the created lead

  • user_id (Integer)

    User id on whose behalf the item is accepted

  • request_options (Amocrm::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/amocrm/resources/unsorted_leads.rb', line 19

def accept(uid, params = {})
  parsed, options = Amocrm::UnsortedLeadAcceptParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/v4/leads/unsorted/%1$s/accept", uid],
    body: parsed,
    model: Amocrm::Models::UnsortedLeadAcceptResponse,
    options: options
  )
end

#create_forms(body:, request_options: {}) ⇒ Amocrm::Models::UnsortedLeadCreateFormsResponse::UnsortedCreateResponse, Amocrm::Models::UnsortedLeadCreateFormsResponse::Problem



38
39
40
41
42
43
44
45
46
47
# File 'lib/amocrm/resources/unsorted_leads.rb', line 38

def create_forms(params)
  parsed, options = Amocrm::UnsortedLeadCreateFormsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v4/leads/unsorted/forms",
    body: parsed[:body],
    model: Amocrm::Models::UnsortedLeadCreateFormsResponse,
    options: options
  )
end

#decline(uid, user_id: nil, request_options: {}) ⇒ Amocrm::Models::UnsortedLeadDeclineResponse::UnsortedAcceptResponse, Amocrm::Models::UnsortedLeadDeclineResponse::Problem

Parameters:

  • uid (String)
  • user_id (Integer)

    User id on whose behalf the item is declined

  • request_options (Amocrm::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



60
61
62
63
64
65
66
67
68
69
# File 'lib/amocrm/resources/unsorted_leads.rb', line 60

def decline(uid, params = {})
  parsed, options = Amocrm::UnsortedLeadDeclineParams.dump_request(params)
  @client.request(
    method: :delete,
    path: ["api/v4/leads/unsorted/%1$s/decline", uid],
    body: parsed,
    model: Amocrm::Models::UnsortedLeadDeclineResponse,
    options: options
  )
end