Class: StickyIoRestfulApiV2025731::ProspectsController
- Inherits:
-
BaseController
- Object
- BaseController
- StickyIoRestfulApiV2025731::ProspectsController
- Defined in:
- lib/sticky_io_restful_api_v2025731/controllers/prospects_controller.rb
Overview
ProspectsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#add_custom_field_values(body, domain, v2_ext, prospect_id) ⇒ ApiResponse
Attach an existing prospect’s custom fields and assign values for them to the prospects.
-
#create_prospect_interest(body, domain, v2_ext, prospect_id) ⇒ ApiResponse
Create an interest entity for the prospect.
-
#delete_custom_field_values(domain, v2_ext, prospect_id, custom_field_id) ⇒ ApiResponse
Delete an existing custom field from the list attached to the customer here here.
-
#get_prospect_custom_fields(domain, v2_ext) ⇒ ApiResponse
Fetch a list of all custom fields created for prospects **Response Data**\ Response parameters expected in custom field object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | id | Integer | The custom field ID.
-
#get_prospect_interests(domain, v2_ext, prospect_id) ⇒ ApiResponse
Fetch a list of all interests created for prospects **Response Data** Response parameters expected in interest object contained within the ‘data` field array: | Field | Data Type | Description | | — | — | — | | contact_id | Integer | The interest’s contact ID.
-
#update_custom_field_values(body, domain, v2_ext, prospect_id) ⇒ ApiResponse
Update custom fields list that attached to the prospect.
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
#add_custom_field_values(body, domain, v2_ext, prospect_id) ⇒ ApiResponse
Attach an existing prospect’s custom fields and assign values for them to the prospects. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | custom_fields | Required | - | Array | Array of custom fields. | custom_fields.*.id | Required | - | Integer | The custom field ID. | custom_fields.*.value | Required | - | String | The custom field desired value. description here here
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 93 94 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/prospects_controller.rb', line 66 def add_custom_field_values(body, domain, v2_ext, prospect_id) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/.{domain}{v2_ext}prospects/{prospect_id}/custom_fields', 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(prospect_id, key: 'prospect_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(AddCustomFieldValues.method(:from_hash)) .is_api_response(true)) .execute end |
#create_prospect_interest(body, domain, v2_ext, prospect_id) ⇒ ApiResponse
Create an interest entity for the prospect. **Request Data** Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | id | Required | - | Integer | The interest entity ID. | | type | Required | - | String | The interest’s entity type. | description here here
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/prospects_controller.rb', line 235 def create_prospect_interest(body, domain, v2_ext, prospect_id) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/.{domain}{v2_ext}prospects/{prospect_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(prospect_id, key: 'prospect_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CreateProspectInterest.method(:from_hash)) .is_api_response(true)) .execute end |
#delete_custom_field_values(domain, v2_ext, prospect_id, custom_field_id) ⇒ ApiResponse
Delete an existing custom field from the list attached to the customer here here
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 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/prospects_controller.rb', line 150 def delete_custom_field_values(domain, v2_ext, prospect_id, custom_field_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/.{domain}{v2_ext}prospects/{prospect_id}/custom_fields/{custom_field_id}', 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(prospect_id, key: 'prospect_id') .is_required(true) .should_encode(true)) .template_param(new_parameter(custom_field_id, key: 'custom_field_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(DeleteCustomFieldValues.method(:from_hash)) .is_api_response(true)) .execute end |
#get_prospect_custom_fields(domain, v2_ext) ⇒ ApiResponse
Fetch a list of all custom fields created for prospects **Response Data**\ Response parameters expected in custom field object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | id | Integer | The custom field ID. | field_type_id | Integer | The custom field’s field type ID. | name | String | The custom field name. | token_key | String | The custom field email token field. | is_multi | Integer Flag | Allow for multiple options to be selected. | options | Array | Array of option objects associated with the custom field. | options.*.id | Integer | The option ID. | options.*.value | String | The option value. | type_id | Integer | The custom field’s type ID.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/prospects_controller.rb', line 28 def get_prospect_custom_fields(domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}custom_fields/prospects', Server::SERVER_1) .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)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetProspectCustomFields.method(:from_hash)) .is_api_response(true)) .execute end |
#get_prospect_interests(domain, v2_ext, prospect_id) ⇒ ApiResponse
Fetch a list of all interests created for prospects **Response Data** Response parameters expected in interest object contained within the ‘data` field array: | Field | Data Type | Description | | — | — | — | | contact_id | Integer | The interest’s contact ID. | | type_id | Integer | The interest’s type ID. | | entity_type_id | Integer | The interest’s entity type ID. | | entity_id | Integer | The interest’s entity ID. | here
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/prospects_controller.rb', line 195 def get_prospect_interests(domain, v2_ext, prospect_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}prospects/{prospect_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(prospect_id, key: 'prospect_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetProspectInterests.method(:from_hash)) .is_api_response(true)) .execute end |
#update_custom_field_values(body, domain, v2_ext, prospect_id) ⇒ ApiResponse
Update custom fields list that attached to the prospect. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | custom_fields | Required | - | Array | Array of custom fields. | custom_fields.*.id | Required | - | Integer | The custom field ID. | custom_fields.*.value | Required | - | String | The custom field desired value. type description here here
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/prospects_controller.rb', line 112 def update_custom_field_values(body, domain, v2_ext, prospect_id) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/.{domain}{v2_ext}prospects/{prospect_id}/custom_fields', 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(prospect_id, key: 'prospect_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(UpdateCustomFieldValues.method(:from_hash)) .is_api_response(true)) .execute end |