diff --git a/src/ConstantContact/Definition/ContactsExport.php b/src/ConstantContact/Definition/ContactsExport.php index 717b9d0..423f07e 100644 --- a/src/ConstantContact/Definition/ContactsExport.php +++ b/src/ConstantContact/Definition/ContactsExport.php @@ -9,7 +9,7 @@ * @property array<\PHPFUI\ConstantContact\UUID> $list_ids Exports all of the contacts inside of up to 50 contact lists. This property is mutually exclusive with contact_ids. * @property int $segment_id Specify the segment_id from which you want to export all contacts that meet the specified segment_criteria. This property is mutually exclusive with contact_ids and list_ids. You can only specify one segment_id. * @property array $fields Use this array to export specific contact fields. You must export email_address to successfully export email_optin_source, email_optin_date, email_optout_source, email_optout_date, or email_optout_reason. - * @property string $status Allows you to export only contacts that have a specific status value. Possible values are active (billable), unsubscribed, or removed + * @property string $status Allows you to export only contacts that have a specific status value. Possible values are active (billable), unsubscribed, or removed. Applicable with either `contact_ids` or `list_ids` as the source. */ class ContactsExport extends \PHPFUI\ConstantContact\Definition\Base { diff --git a/src/ConstantContact/Definition/ContactsJsonImport.php b/src/ConstantContact/Definition/ContactsJsonImport.php index b50436d..c5cd2b0 100644 --- a/src/ConstantContact/Definition/ContactsJsonImport.php +++ b/src/ConstantContact/Definition/ContactsJsonImport.php @@ -7,12 +7,14 @@ /** * @property array<\PHPFUI\ConstantContact\Definition\JsonImportContact> $import_data An array containing the contacts to import. * @property array<\PHPFUI\ConstantContact\UUID> $list_ids Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact list_id string values. + * @property string $sms_permission_to_send Specifies if the contact gave explicit SMS permission or if the SMS permission was not set (not_set). If `explicit, the sms_consent_date must be provided. */ class ContactsJsonImport extends \PHPFUI\ConstantContact\Definition\Base { protected static array $fields = [ 'import_data' => 'array<\PHPFUI\ConstantContact\Definition\JsonImportContact>', 'list_ids' => 'array<\PHPFUI\ConstantContact\UUID>', + 'sms_permission_to_send' => 'string', ]; diff --git a/src/ConstantContact/Definition/JsonImportContact.php b/src/ConstantContact/Definition/JsonImportContact.php index 6ec1191..8d094a7 100644 --- a/src/ConstantContact/Definition/JsonImportContact.php +++ b/src/ConstantContact/Definition/JsonImportContact.php @@ -43,6 +43,8 @@ * @property string $other_zip The zip or postal code associated with the contact's other address. * @property string $other_country The name of another country where the contact is located. * @property string $cf:custom_field_name The name of this property is dynamic based on the custom fields you want to import. Use a key-value pair where the key is an existing custom field name prefixed with cf:, and the value is a custom field string value. For example, if you have a custom field named first_name you can use "cf:first_name":"Joe". Each contact can contain up to 25 different custom fields. + * @property string $sms_number The US phone number to associate with the contact's SMS-enabled phone. The country code must be valid. Valid formats are 1231231234 or 123-123-1234. + * @property string $sms_consent_date Required if the SMS permission is set to `explict`. The date that the contact consented to receiving SMS messages. Valid date formats are MM/DD/YYYY, M/D/YYYY, YYYY/MM/DD, YYYY/M/D, YYYY-MM-DD, YYYY-M-D,M-D-YYYY, or M-DD-YYYY . */ class JsonImportContact extends \PHPFUI\ConstantContact\Definition\Base { @@ -85,6 +87,8 @@ class JsonImportContact extends \PHPFUI\ConstantContact\Definition\Base 'other_zip' => 'string', 'other_country' => 'string', 'cf:custom_field_name' => 'string', + 'sms_number' => 'string', + 'sms_consent_date' => 'string', ]; @@ -124,6 +128,8 @@ class JsonImportContact extends \PHPFUI\ConstantContact\Definition\Base 'other_zip' => 50, 'other_country' => 50, 'cf:custom_field_name' => 255, + 'sms_number' => 16, + 'sms_consent_date' => 16, ]; } diff --git a/src/ConstantContact/Definition/PlanInfo.php b/src/ConstantContact/Definition/PlanInfo.php index 4c8bc46..f87d637 100644 --- a/src/ConstantContact/Definition/PlanInfo.php +++ b/src/ConstantContact/Definition/PlanInfo.php @@ -5,19 +5,21 @@ namespace PHPFUI\ConstantContact\Definition; /** - * @property string $plan_type The type of billing plan (plan_type) to associate with a client's Constant Contact account. The type of billing plan determines which Constant Contact product features that the client account can access. The billing plan type that you enter must already exist in your plan group or a 400 error message is returned. After changing the plan_type from TRIAL to any other billing plan type, you cannot change it back to TRIAL. + * @property string $plan_type Use this property to update the client account billing plan to a different billing plan. After changing the plan_type from TRIAL to any other billing plan type, you cannot change it back to TRIAL. * + * @property int $plan_group_id Updates an existing client account billing plan group to a new billing plan group. If you don't know the `plan_group_id` to use, contact our API support team. * @property int $billing_day_of_month This property is required if a client account is not set up to use single billing. You can choose to enter a specific day of the month or accept the default value, which is the day on which the plan_type value changes from a TRIAL plan to a different plan_type. For trial accounts, the value defaults to null. You can only change the billing_day_of_month when changing the plan_type value from TRIAL to a different plan_type, otherwise the value you enter is ignored. */ class PlanInfo extends \PHPFUI\ConstantContact\Definition\Base { protected static array $fields = [ 'plan_type' => 'string', + 'plan_group_id' => 'int', 'billing_day_of_month' => 'int', ]; diff --git a/src/ConstantContact/V3/Account/Summary/PhysicalAddress.php b/src/ConstantContact/V3/Account/Summary/PhysicalAddress.php index db9580a..b11a471 100644 --- a/src/ConstantContact/V3/Account/Summary/PhysicalAddress.php +++ b/src/ConstantContact/V3/Account/Summary/PhysicalAddress.php @@ -26,6 +26,25 @@ public function get() : array return $this->doGet([]); } + /** + * 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. + * + * @param \PHPFUI\ConstantContact\Definition\AccountPhysicalAddress $body 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. + */ + public function post(\PHPFUI\ConstantContact\Definition\AccountPhysicalAddress $body) : array + { + + return $this->doPost(['body' => $body->getData(), ]); + } + /** * PUT (update) the Physical Address for an Account * diff --git a/src/ConstantContact/V3/Partner/Accounts/Plan.php b/src/ConstantContact/V3/Partner/Accounts/Plan.php index a2d593b..8de2d45 100644 --- a/src/ConstantContact/V3/Partner/Accounts/Plan.php +++ b/src/ConstantContact/V3/Partner/Accounts/Plan.php @@ -39,10 +39,10 @@ public function get(string $encoded_account_id) : array * Use this PUT method to update the type of billing plan to assign to * the Constant Contact client account. The type of billing plan determines * which Constant Contact product features that the client account can - * access. The billing plan type (`plan_type`) that you enter must already - * exist in the plan group. Attempting to change to a plan that is currently - * not available within your partner plan group results in a 400 error - * response code. + * access. The billing plan that you specify in the request body (`plan_type`) + * must already exist in the plan group. Attempting to change to a plan + * that is currently not available within your partner plan group results + * in a 400 error response code. * * When you create a new client account, the `plan_type` defaults to `TRIAL` * and the `billing_day_of_month` defaults to `null`. The `billing_day_of_month` @@ -67,16 +67,15 @@ public function get(string $encoded_account_id) : array * in the API guide. * * @param string $encoded_account_id Specify the client's unique `encoded_account_id`. - * @param \PHPFUI\ConstantContact\Definition\PlanInfo $body Update the billing plan (`plan_type`) for an existing Constant Contact client account. Options include: - - `TRIAL`: A non-billed account with an expiration date that allows clients to try Constant Contact product features. + * @param \PHPFUI\ConstantContact\Definition\PlanInfo $body `plan_type`: Updates the billing plan assigned to a client account to a different `plan_type`. - - `GOLD`: A billable plan that provides all available product features. +`plan_group_id`: To update an older `plan_type` to a current a `plan_type`, use the `plan_group_id` parameter to specify the older billing `plan_type` number. - - `SILVER`: A billable plan that provides all features available in the BRONZE plan, and adds some additional email campaign feature such as contact segmentation and social media advertisements. +- If the specified `plan_group_id` does not exist under the account's current plan group, the default partner plan group is used. +- If the specified `plan_group_id` exists but does not match the account's current plan group, an error is returned. +- If the `plan_group_id` parameter is not included in the request, the accounts current plan group is used. - - `BRONZE`: A billable plan that provides basic email and marketing tools. - -If updating from a `TRIAL` plan (`plan_type`) to another type of billing plan, you have the option to update the day of month (`billing_day_of_month`) in which to bill the client account. Valid values include `1` through to and including `31`. Any additional billing plan properties and values that you include in the request body are ignored. If you are not on the latest billing plan, contact the Constant Contact Partner Team. However, older billing plans and `plan_type` enum values will continue to be supported. +`billing_day_of _month`: Updates the day of month in which to bill the client account. This property is required if a client account is not set up to use single billing. */ public function put(string $encoded_account_id, ?\PHPFUI\ConstantContact\Definition\PlanInfo $body = null) : array { diff --git a/yaml/swagger.yaml b/yaml/swagger.yaml index 015e607..11435bf 100644 --- a/yaml/swagger.yaml +++ b/yaml/swagger.yaml @@ -3,7 +3,7 @@ swagger: "2.0" info: description: "The Constant Contact, Inc. V3 public API, for building integrations\ \ with Constant Contact, the leading small-business email marketing platform." - version: "3.0.2430" + version: "3.0.2475" title: "AppConnect V3" contact: name: "webservices@constantcontact.com" @@ -237,6 +237,63 @@ paths: x-authorization-privileges: - "account:read" x-sdk-methodName: "getAccountPhysicalAddress" + post: + tags: + - "Account Services" + summary: "POST the Physical Address for the Account" + description: "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." + operationId: "addPhysicalAddress" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "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." + required: true + schema: + $ref: "#/definitions/AccountPhysicalAddress" + responses: + "201": + description: "Request successful" + schema: + $ref: "#/definitions/AccountPhysicalAddress" + "400": + description: "Bad request. Either the JSON was malformed or there was a\ + \ data validation error." + "401": + description: "The Access Token used is invalid." + "403": + description: "Forbidden request. You lack the necessary scopes, you lack\ + \ the necessary user privileges, or the application is deactivated." + "404": + description: "Forbidden request. You lack the necessary scopes, you lack\ + \ the necessary user privileges, or the application is deactivated." + "409": + description: "Forbidden request. You lack the necessary scopes, you lack\ + \ the necessary user privileges, or the application is deactivated." + "415": + description: "Unsupported Media Type." + "500": + description: "There was a problem with our internal service." + "503": + description: "Our internal service is temporarily unavailable." + security: + - oauth2_implicit: + - "account_update" + - oauth2_access_code: + - "account_update" + - api_key: [] + x-authorization-privileges: + - "account:update" put: tags: - "Account Services" @@ -5787,26 +5844,26 @@ paths: description: "Use this PUT method to update the type of billing plan to assign\ \ to the Constant Contact client account. The type of billing plan determines\ \ which Constant Contact product features that the client account can access.\ - \ The billing plan type (`plan_type`) that you enter must already exist in\ - \ the plan group. Attempting to change to a plan that is currently not available\ - \ within your partner plan group results in a 400 error response code.\n\n\ - When you create a new client account, the `plan_type` defaults to `TRIAL`\ - \ and the `billing_day_of_month` defaults to `null`. The `billing_day_of_month`\ - \ property is required if a client account is not set up to use single billing.\ - \ You can change the day of month (`billing_day_of_month`) in which to bill\ - \ a client account only when changing the `plan_type` value from `TRIAL` to\ - \ a different `plan_type`, otherwise the `billing_day_of_month` value you\ - \ enter is ignored. You can choose to enter a specific day of the month or\ - \ accept the default value, which is the day on which the `plan_type` value\ - \ changes from a `TRIAL` plan to a different `plan_type`. Changing the `plan_type`\ - \ from `TRIAL` to another `plan_type` automatically changes the `billing_status`\ - \ from `Trial` to `Open`.\n\nOnly technology partners can access partner endpoints\ - \ and partner endpoints cannot be tested using the API reference tester. If\ - \ you are not on the latest billing plan, contact the Constant Contact Partner\ - \ Team. However, older billing plans and `plan_type` enum values will continue\ - \ to be supported.\n\nFor more use case information, see [PUT Billing Plan\ - \ Details for a Client Account](/api_guide/partners_plans_update.html) in\ - \ the API guide." + \ The billing plan that you specify in the request body (`plan_type`) must\ + \ already exist in the plan group. Attempting to change to a plan that is\ + \ currently not available within your partner plan group results in a 400\ + \ error response code.\n\nWhen you create a new client account, the `plan_type`\ + \ defaults to `TRIAL` and the `billing_day_of_month` defaults to `null`. The\ + \ `billing_day_of_month` property is required if a client account is not set\ + \ up to use single billing. You can change the day of month (`billing_day_of_month`)\ + \ in which to bill a client account only when changing the `plan_type` value\ + \ from `TRIAL` to a different `plan_type`, otherwise the `billing_day_of_month`\ + \ value you enter is ignored. You can choose to enter a specific day of the\ + \ month or accept the default value, which is the day on which the `plan_type`\ + \ value changes from a `TRIAL` plan to a different `plan_type`. Changing the\ + \ `plan_type` from `TRIAL` to another `plan_type` automatically changes the\ + \ `billing_status` from `Trial` to `Open`.\n\nOnly technology partners can\ + \ access partner endpoints and partner endpoints cannot be tested using the\ + \ API reference tester. If you are not on the latest billing plan, contact\ + \ the Constant Contact Partner Team. However, older billing plans and `plan_type`\ + \ enum values will continue to be supported.\n\nFor more use case information,\ + \ see [PUT Billing Plan Details for a Client Account](/api_guide/partners_plans_update.html)\ + \ in the API guide." operationId: "setPlan" consumes: - "application/json" @@ -5821,21 +5878,18 @@ paths: x-example: "a07e1lxqqqo0" - in: "body" name: "body" - description: "Update the billing plan (`plan_type`) for an existing Constant\ - \ Contact client account. Options include:\n - `TRIAL`: A non-billed account\ - \ with an expiration date that allows clients to try Constant Contact product\ - \ features.\n\n - `GOLD`: A billable plan that provides all available product\ - \ features.\n\n - `SILVER`: A billable plan that provides all features\ - \ available in the BRONZE plan, and adds some additional email\ - \ campaign feature such as contact segmentation and social media advertisements.\n\ - \n - `BRONZE`: A billable plan that provides basic email and marketing\ - \ tools. \n\nIf updating from a `TRIAL` plan (`plan_type`) to another type\ - \ of billing plan, you have the option to update the day of month (`billing_day_of_month`)\ - \ in which to bill the client account. Valid values include `1` through\ - \ to and including `31`. Any additional billing plan properties and values\ - \ that you include in the request body are ignored. If you are not on the\ - \ latest billing plan, contact the Constant Contact Partner Team. However,\ - \ older billing plans and `plan_type` enum values will continue to be supported." + description: "`plan_type`: Updates the billing plan assigned to a client account\ + \ to a different `plan_type`. \n\n`plan_group_id`: To update an older\ + \ `plan_type` to a current a `plan_type`, use the `plan_group_id` parameter\ + \ to specify the older billing `plan_type` number. \n\n- If the specified\ + \ `plan_group_id` does not exist under the account's current plan group,\ + \ the default partner plan group is used.\n- If the specified `plan_group_id`\ + \ exists but does not match the account's current plan group, an error is\ + \ returned.\n- If the `plan_group_id` parameter is not included in the request,\ + \ the accounts current plan group is used.\n\n`billing_day_of _month`: \ + \ Updates the day of month in which to bill the client account. This property\ + \ is required if a client account is not set up to use single billing. \ + \ " required: false schema: $ref: "#/definitions/PlanInfo" @@ -6915,7 +6969,8 @@ definitions: example: "unsubscribed" description: "Allows you to export only contacts that have a specific status\ \ value. Possible values are active (billable), unsubscribed,\ - \ or removed" + \ or removed. Applicable with either `contact_ids` or `list_ids`\ + \ as the source." description: "You can export contact objects to a CSV file. By default, all contacts\ \ in the user's account are exported if none of the following properties are\ \ included:
  • By contact_id - you can specify up to 500 specific contacts.\ @@ -7189,7 +7244,8 @@ definitions: items_total_count: type: "integer" example: 87 - description: "The total number of rows in the import file." + description: "The total number of rows, including the header row, in the\ + \ import file." readOnly: true person_count: type: "integer" @@ -7444,6 +7500,21 @@ definitions: \ you can use \"cf:first_name\":\"Joe\". Each contact can contain\ \ up to 25 different custom fields." maxLength: 255 + sms_number: + type: "string" + example: "5081231235" + description: "The US phone number to associate with the contact's SMS-enabled\ + \ phone. The country code must be valid. Valid formats are 1231231234\ + \ or 123-123-1234." + maxLength: 16 + sms_consent_date: + type: "string" + example: "07-03-2024" + description: "Required if the SMS permission is set to `explict`. The date\ + \ that the contact consented to receiving SMS messages. Valid date formats\ + \ are MM/DD/YYYY, M/D/YYYY, YYYY/MM/DD, YYYY/M/D, YYYY-MM-DD, YYYY-M-D,M-D-YYYY,\ + \ or M-DD-YYYY ." + maxLength: 16 ContactsJsonImport: type: "object" required: @@ -7465,6 +7536,12 @@ definitions: example: "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a" maxItems: 50 minItems: 1 + sms_permission_to_send: + type: "string" + example: "explicit" + description: "Specifies if the contact gave explicit SMS permission\ + \ or if the SMS permission was not set (not_set). If `explicit,\ + \ the sms_consent_date must be provided." ListActivityRemoveContacts: type: "object" required: @@ -12450,11 +12527,8 @@ definitions: plan_type: type: "string" example: "GOLD" - description: "The type of billing plan (plan_type) to associate\ - \ with a client's Constant Contact account. The type of billing plan determines\ - \ which Constant Contact product features that the client account can access.\ - \ The billing plan type that you enter must already exist in your plan group\ - \ or a 400 error message is returned. After changing the plan_type\ + description: "Use this property to update the client account billing plan\ + \ to a different billing plan. After changing the plan_type\ \ from TRIAL to any other billing plan type, you cannot change\ \ it back to TRIAL.\n " + plan_group_id: + type: "integer" + format: "int32" + example: 152 + description: "Updates an existing client account billing plan group to a new\ + \ billing plan group. If you don't know the `plan_group_id` to use, contact\ + \ our API support team." billing_day_of_month: type: "integer" format: "int32" @@ -12474,8 +12555,8 @@ definitions: \ billing_day_of_month when changing the plan_type\ \ value from TRIAL to a different plan_type, otherwise\ \ the value you enter is ignored." - description: "Specifies the type of billing plan (`plan_type`) and the billing\ - \ date (`billing_day_of_month`) used for a client account." + description: "Specifies the type of billing plan and the billing date to use for\ + \ a client account." AccountCancellation: type: "object" properties: