Class: StickyIoRestfulApiV2025731::InterestsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/interests_controller.rb

Overview

InterestsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#create_contact_interest(body, domain, v2_ext, contact_id) ⇒ ApiResponse

Create a contact interest to a product by Contact ID **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | type | Required | - | String | The entity type name, which has to be ‘product` | id | Required | - | Integer | The entity ID. The product ID for the product entity type description here here

Parameters:

  • body (CreateContactInterestRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • contact_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/sticky_io_restful_api_v2025731/controllers/interests_controller.rb', line 66

def create_contact_interest(body,
                            domain,
                            v2_ext,
                            contact_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}contacts/{contact_id}/interests',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(contact_id, key: 'contact_id')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_contact_interests(domain, v2_ext, contact_id) ⇒ ApiResponse

Fetch a list of all interests to products by the customer ID **Response Data**\ Response parameters expected in interest object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | contact_id | Integer | The contact ID. | entity_type_id | Integer | The entity type ID. 3 is for the product entity type | entity_id | Integer | The entity ID. The product ID for the product entity type | type_id | Integer | The type ID. 2 is for the interest here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • contact_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/sticky_io_restful_api_v2025731/controllers/interests_controller.rb', line 26

def get_contact_interests(domain,
                          v2_ext,
                          contact_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}contacts/{contact_id}/interests',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(contact_id, key: 'contact_id')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end