Skip to content

Latest commit

 

History

History
593 lines (414 loc) · 25.4 KB

AccountServicesApi.md

File metadata and controls

593 lines (414 loc) · 25.4 KB

ConstantContactClient::AccountServicesApi

All URIs are relative to https://api.cc.email/v3

Method HTTP request Description
add_account_email_address POST /account/emails POST Add an Account Email Address
add_physical_address POST /account/summary/physical_address POST the Physical Address for the Account
get_account_details GET /account/summary GET a Summary of Account Details
get_account_physical_address GET /account/summary/physical_address GET the Physical Address for the Account
get_all_account_email_addresses GET /account/emails GET a Collection of Account Email Addresses
get_user_privileges GET /account/user/privileges GET User Privileges
update_account PUT /account/summary PUT (update) Account Details
update_account_physical_address PUT /account/summary/physical_address PUT (update) the Physical Address for an Account

add_account_email_address

add_account_email_address(add_account_email_address_request)

POST Add an Account Email Address

Use this method to add a new email address to a Constant Contact account. If the email address you are adding already exists in the account the API will return a 409 conflict error. When you add a new email address to an account, Constant Contact automatically sends an email to that address with a link to confirm it. After a user clicks that link, the account email status changes from UNCONFIRMED to CONFIRMED. You can use confirmed account email addresses in the email campaign from_email and reply_to_email headers. For more use case information, see Add an Account Email Address in the API guide.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new
add_account_email_address_request = ConstantContactClient::AddAccountEmailAddressRequest.new # AddAccountEmailAddressRequest | A JSON request payload containing the new email address you want to add to the Constant Contact account.

begin
  # POST Add an Account Email Address
  result = api_instance.add_account_email_address(add_account_email_address_request)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->add_account_email_address: #{e}"
end

Using the add_account_email_address_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> add_account_email_address_with_http_info(add_account_email_address_request)

begin
  # POST Add an Account Email Address
  data, status_code, headers = api_instance.add_account_email_address_with_http_info(add_account_email_address_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <AddAccountEmailAddress201Response>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->add_account_email_address_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
add_account_email_address_request AddAccountEmailAddressRequest A JSON request payload containing the new email address you want to add to the Constant Contact account.

Return type

AddAccountEmailAddress201Response

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

add_physical_address

add_physical_address(get_account_details200_response_physical_address)

POST the Physical Address for the Account

Use this method to add the address where the account's organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new
get_account_details200_response_physical_address = ConstantContactClient::GetAccountDetails200ResponsePhysicalAddress.new({address_line1: '123 Maple Street', city: 'Boston', country_code: 'US'}) # GetAccountDetails200ResponsePhysicalAddress | Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address.

begin
  # POST the Physical Address for the Account
  result = api_instance.add_physical_address(get_account_details200_response_physical_address)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->add_physical_address: #{e}"
end

Using the add_physical_address_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> add_physical_address_with_http_info(get_account_details200_response_physical_address)

begin
  # POST the Physical Address for the Account
  data, status_code, headers = api_instance.add_physical_address_with_http_info(get_account_details200_response_physical_address)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAccountDetails200ResponsePhysicalAddress>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->add_physical_address_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
get_account_details200_response_physical_address GetAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address.

Return type

GetAccountDetails200ResponsePhysicalAddress

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

get_account_details

get_account_details(opts)

GET a Summary of Account Details

Get account related details for a Constant Contact user account. Use the extra_fields query parameter to include the company_logo and/or physical_address details in the response body. For more details, see Get Account Summary Details.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new
opts = {
  extra_fields: 'physical_address' # String | Use the `extra_fields` query parameter to include the `physical_address` and/or `company_logo` details in the response body. Use a comma separated list to include both (physical_address, company logo).
}

begin
  # GET a Summary of Account Details
  result = api_instance.get_account_details(opts)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_account_details: #{e}"
end

Using the get_account_details_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_account_details_with_http_info(opts)

begin
  # GET a Summary of Account Details
  data, status_code, headers = api_instance.get_account_details_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAccountDetails200Response>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_account_details_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
extra_fields String Use the `extra_fields` query parameter to include the `physical_address` and/or `company_logo` details in the response body. Use a comma separated list to include both (physical_address, company logo). [optional]

Return type

GetAccountDetails200Response

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_account_physical_address

get_account_physical_address

GET the Physical Address for the Account

Use this method to get the address where the account's organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new

begin
  # GET the Physical Address for the Account
  result = api_instance.get_account_physical_address
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_account_physical_address: #{e}"
end

Using the get_account_physical_address_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_account_physical_address_with_http_info

begin
  # GET the Physical Address for the Account
  data, status_code, headers = api_instance.get_account_physical_address_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAccountDetails200ResponsePhysicalAddress>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_account_physical_address_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

GetAccountDetails200ResponsePhysicalAddress

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_all_account_email_addresses

<Array> get_all_account_email_addresses(opts)

GET a Collection of Account Email Addresses

Use this method to return a collection of email addresses for the account associated with your access token. When you <a href="https://v3.developer.constantcontact.com/api_reference/index.html#!/Email_Campaigns/createEmailCampaignUsingPOST\" target="_blank">Create an Email Campaign, you must use an account email address with a CONFIRMED status in the email campaign from_email and reply_to_email headers. Use the query parameters to filter results. You can filter using confirm_status, role_code, or email_address. For example, searching with confirm_status=CONFIRMED returns all confirmed email addresses in the account. This method only supports one query parameter at a time.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new
opts = {
  confirm_status: 'CONFIRMED', # String | Use the `confirm_status` query parameter to search for account emails using the email status. Possible values are `CONFIRMED` or `UNCONFIRMED`. You can also abbreviate the values of this query parameter and use `C` or `U`. 
  role_code: 'CONTACT', # String | Use the `role_code` query parameter to search for account emails that have a specific role. Each each email address in an account can have multiple roles or no role. Possible values are `CONTACT`, `BILLING`, `REPLY_TO`, `JOURNALING`, or `OTHER`. You can also abbreviate the value of this query parameter and use `C`,`B`,`R`,`J`, or `O`.
  email_address: 'email_address_example' # String | Use the `email_address` query parameter to search for a specific account email address.
}

begin
  # GET a Collection of Account Email Addresses
  result = api_instance.get_all_account_email_addresses(opts)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_all_account_email_addresses: #{e}"
end

Using the get_all_account_email_addresses_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> get_all_account_email_addresses_with_http_info(opts)

begin
  # GET a Collection of Account Email Addresses
  data, status_code, headers = api_instance.get_all_account_email_addresses_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<GetAllAccountEmailAddresses200ResponseInner>>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_all_account_email_addresses_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
confirm_status String Use the `confirm_status` query parameter to search for account emails using the email status. Possible values are `CONFIRMED` or `UNCONFIRMED`. You can also abbreviate the values of this query parameter and use `C` or `U`. [optional]
role_code String Use the `role_code` query parameter to search for account emails that have a specific role. Each each email address in an account can have multiple roles or no role. Possible values are `CONTACT`, `BILLING`, `REPLY_TO`, `JOURNALING`, or `OTHER`. You can also abbreviate the value of this query parameter and use `C`,`B`,`R`,`J`, or `O`. [optional]
email_address String Use the `email_address` query parameter to search for a specific account email address. [optional]

Return type

Array<GetAllAccountEmailAddresses200ResponseInner>

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_user_privileges

<Array> get_user_privileges

GET User Privileges

Use this method to return the user privileges associated with your access token as an array of objects. This method returns all user privileges, including privileges the V3 API does not currently use. Constant Contact requires specific user privileges to make requests using the V3 API. For more information, see the User Privileges and Roles Overview.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new

begin
  # GET User Privileges
  result = api_instance.get_user_privileges
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_user_privileges: #{e}"
end

Using the get_user_privileges_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> get_user_privileges_with_http_info

begin
  # GET User Privileges
  data, status_code, headers = api_instance.get_user_privileges_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<GetUserPrivileges200ResponseInner>>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->get_user_privileges_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Array<GetUserPrivileges200ResponseInner>

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

update_account

update_account(update_account_request)

PUT (update) Account Details

Use this method to update account details for a Constant Contact account, such as the email address or phone number. This PUT method provides a partial update where only valid properties that you include in the request body are updated and excluded properties are not overwritten. For more details, see Put (update) Account Summary Details.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new
update_account_request = ConstantContactClient::UpdateAccountRequest.new # UpdateAccountRequest | In the request body, specify changes to account details by including and modifying all or select `CustomerPut` properties. Changes to read-only fields (`encoded_account_id`) are ignored.

begin
  # PUT (update) Account Details
  result = api_instance.update_account(update_account_request)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->update_account: #{e}"
end

Using the update_account_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_account_with_http_info(update_account_request)

begin
  # PUT (update) Account Details
  data, status_code, headers = api_instance.update_account_with_http_info(update_account_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <UpdateAccountRequest>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->update_account_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
update_account_request UpdateAccountRequest In the request body, specify changes to account details by including and modifying all or select `CustomerPut` properties. Changes to read-only fields (`encoded_account_id`) are ignored.

Return type

UpdateAccountRequest

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

update_account_physical_address

update_account_physical_address(get_account_details200_response_physical_address)

PUT (update) the Physical Address for an Account

Use this method to update the organization's physical address for the Constant Contact user account. The physical address is required to send emails and displays on the footer of every email that is sent from the account. To get the current physical address, make a GET call to /account/summary/physical_address. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. For more details, see Put (update) the Physical Address for the Account. You must have the role of Account Owner assigned to update account level details.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::AccountServicesApi.new
get_account_details200_response_physical_address = ConstantContactClient::GetAccountDetails200ResponsePhysicalAddress.new({address_line1: '123 Maple Street', city: 'Boston', country_code: 'US'}) # GetAccountDetails200ResponsePhysicalAddress | Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address.

begin
  # PUT (update) the Physical Address for an Account
  result = api_instance.update_account_physical_address(get_account_details200_response_physical_address)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->update_account_physical_address: #{e}"
end

Using the update_account_physical_address_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_account_physical_address_with_http_info(get_account_details200_response_physical_address)

begin
  # PUT (update) the Physical Address for an Account
  data, status_code, headers = api_instance.update_account_physical_address_with_http_info(get_account_details200_response_physical_address)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetAccountDetails200ResponsePhysicalAddress>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling AccountServicesApi->update_account_physical_address_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
get_account_details200_response_physical_address GetAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address.

Return type

GetAccountDetails200ResponsePhysicalAddress

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json