Module: ActiveCampaign::API::Addresses
- Defined in:
- lib/active_campaign/api/addresses.rb
Overview
Interface to address endpoints
Instance Method Summary collapse
-
#create_address(params) ⇒ Hash
Create a new address.
-
#delete_address(id) ⇒ Hash
Deletes a address with given id.
-
#delete_address_group(id) ⇒ Hash
Delete address associated with a specific user group.
-
#delete_address_list(id) ⇒ Hash
Delete address associated with a specific list.
-
#show_address(id) ⇒ Hash
Get a single address.
-
#show_addresses(*params) ⇒ Array<Hash>
Get a list of address.
-
#update_address(id, params) ⇒ Hash
Update an existing address with given id.
Instance Method Details
#create_address(params) ⇒ Hash
Create a new address
30 31 32 |
# File 'lib/active_campaign/api/addresses.rb', line 30 def create_address(params) post('addresses', address: params, change_case: false) end |
#delete_address(id) ⇒ Hash
Deletes a address with given id
85 86 87 |
# File 'lib/active_campaign/api/addresses.rb', line 85 def delete_address(id) delete("addresses/#{id}") end |
#delete_address_group(id) ⇒ Hash
Delete address associated with a specific user group
96 97 98 |
# File 'lib/active_campaign/api/addresses.rb', line 96 def delete_address_group(id) delete("addressGroups/#{id}") end |
#delete_address_list(id) ⇒ Hash
Delete address associated with a specific list
107 108 109 |
# File 'lib/active_campaign/api/addresses.rb', line 107 def delete_address_list(id) delete("addressGroups/#{id}") end |
#show_address(id) ⇒ Hash
Get a single address
41 42 43 |
# File 'lib/active_campaign/api/addresses.rb', line 41 def show_address(id) get("addresses/#{id}") end |
#show_addresses(*params) ⇒ Array<Hash>
Get a list of address
50 51 52 |
# File 'lib/active_campaign/api/addresses.rb', line 50 def show_addresses(*params) get('addresses', *params) end |
#update_address(id, params) ⇒ Hash
Update an existing address with given id
74 75 76 |
# File 'lib/active_campaign/api/addresses.rb', line 74 def update_address(id, params) put("addresses/#{id}", address: params, change_case: false) end |