Wooxy API v.3.0

Update Contact Data

The Update Contact Data method allows you to update a contact in a specific already created list.

The parameter "contactGender" can accept values other than integers, such as:

  • Not known: ['',  'unknown',  'undefined',  'empty'];
  • Male: ['m', 'male'];
  • Female: ['f', 'female'];
  • Not applicable: ['n/a', 'not applicable', 'na'].

Important! The format for various time zones.

Request

POST
https://api.wooxy.com/v3/contacts/update

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
  "contactListId": "YOUR_CONTACT_LIST_ID",
  "webHookUri": "YOUR_WEBHOOK_URL",
  "upsert": false,
  "contacts": [
    {
      "contact": "+15555555",      
      "name": "John Doe",
      "email": "user@example.com",
      "phoneNumber": "+15555555",
      "userId": "myUserId",
      "active": true,
      "emailSubscribe": true,
      "smsSubscribe": true,
      "desktopWebPushSubscribe": true,
      "mobileWebPushSubscribe": true,
      "telegramSubscribe": true,
      "viberSubscribe": true,
      "firstName": "John",
      "lastName": "Doe",
      "contactBirthday": "1990-01-01",
      "contactLanguage": "en",
      "contactGender ": 2,
      "contactTimezone": "Europe/Tallinn",
      "contactScore": 100,
      "avatarLink": "https://img.wooxy.com/g/06c38b4568.jpg",
      "facebookLink": "https://facebook.com/wooxy.com",
      "instagramLink": "https://instagram.com/wooxy",
      "linkedInLink": "https://linkedin.com/company/wooxy",
      "twitterLink": "https://twitter.com/wooxy",
      "tiktokLink": "https://tiktok.com/wooxy",
      "sourceId": "Source_ID_from_Wooxy",
      "customerSourceId": "Customer_Source_ID_From_Your_Platform",
      "cac": {
        "value": "2.05",
        "currency": "USD"
      },
      "variables": [
        {
          "name": "newVariableName",
          "value": "newVariableValue"
        }
      ]
    }
  ]
}
                                    

Parameters

Title Type Default Description

contactListId

required
string

ID of the contact list where the contact to be updated belongs.  
The list should be already created in your account on the Lists page:  
https://app.wooxy.com/email-list

webHookUri

optional
string

The Wooxy will send a POST request to your webHookUri with the status of the request as soon as it is processed.

upsert

optional
boolean false

You can set if the contact should be added to the list if it does not exist at the time of the request:

  • true: Create a new contact if it does not exist;
  • false: Do not create contact if it does not exist.

contacts

required
array

An array of information on contacts batch you want to update.
IMPORTANT You can update only 100 contacts at once.
IMPORTANT Minimum one unique user identificator (userId | email | phoneNumber ) is required.

contacts.contact

required
string

The unique user identificator (userId | email | phoneNumber) of the contact you want to update.

contacts.name

optional
string

The optional display name to use for the recipient.

contacts.email

optional
string

Contact’s email address.

contacts.phoneNumber

optional
string

IMPORTANT: should be valid E.164 phone number format.

contacts.userId

optional
string

Contact’s unique user ID from your platform to enable management of the contact in the list based on it.

contacts.active

optional
boolean false

You can set if the contact is enabled on the contact list or not.
The default value is false (disabled):

  • true: Contact enabled. Contact can receive communication from enabled channels;
  • false: Contact disabled. No communications will be sent to this contact.

contacts.emailSubscribe

optional
boolean false

You can set if the contact is subscribed to receiving emails or not.
The default value is false (unsubscribed):

  • true: Subscribe contact to emails;
  • false: Unsubscribe contact from emails.

contacts.smsSubscribe

optional
boolean false

You can set if the contact is subscribed to receiving SMS or not.
The default value is false (unsubscribed):

  • true: Subscribe contact to SMS;
  • false: Unsubscribe contact from SMS.

contacts.desktopWebPushSubscribe

optional
boolean false

You can set if the contact is subscribed to receiving desktop web push notifications or not.
The default value is false (unsubscribed):

  • true: Subscribe contact to desktop web push notifications;
  • false: Unsubscribe contact from desktop web push notifications.

contacts.mobileWebPushSubscribe

optional
boolean false

You can set if the contact is subscribed to receiving mobile web push notifications or not.
The default value is false (unsubscribed):

  • true: Subscribe contact to mobile web push notifications;
  • false: Unsubscribe contact from mobile web push notification.

contacts.telegramSubscribe

optional
boolean false

You can set if the contact is subscribed to receiving Telegram messages or not.
The default value is false (unsubscribed):

  • true: Subscribe contact to Telegram messages;
  • false: Unsubscribe contact from Telegram messages.

contacts.viberSubscribe

optional
boolean false

You can set if the contact is subscribed to receiving Viber communications or not.
The default value is false (unsubscribed):

  • true: Subscribe contact to Viber communication;
  • false: Unsubscribe contact from Viber communication.

contacts.firstName

optional
string

Contact’s first name.

contacts.lastName

optional
string

Contact’s last name.

contacts.contactBirthday

optional
string

Contact’s birth date in ENUM_DATE (YYYY-MM-DD) format.

contacts.contactLanguage

optional
string " "

Contact’s locale in ISO 639-1 format.

contacts.contactGender

optional
integer 0

Contact’s gender in ISO/IEC 5218 format:

  • 0: Not known;
  • 1: Male;
  • 2:  Female;
  • 9:  Not applicable.

contacts.contactTimezone

optional
string

Contact’s timezone in ISO 8601 format.

contacts.contactScore

optional
integer null

Contact Score.

contacts.avatarLink

optional
string

Link to contact’s avatar image.

contacts.facebookLink

optional
string

Link to contact’s Facebook profile.

contacts.instagramLink

optional
string

Link to contact’s Instagram profile.

contacts.linkedInLink

optional
string

Link to contact’s LinkedIn profile.

contacts.twitterLink

optional
string

Link to contact’s Twitter profile.

contacts.tiktokLink

optional
string

Link to contact’s TikTok profile.

variables

optional
array null

An array of contact variables and their values.

variables.name

required
string

Variable name in lowerCamelCase format.
IMPORTANT Please use only latin lowerCamelCase format. No numbers or other symbols allowed.

variables.value

required
string

Variable value in 'ENUM_STRING' or 'ENUM_DATE' format correspondingly.

sourceId

optional
string

Contact’s unique source ID from Wooxy platform.

customerSourceId

optional
string

Contact’s unique source ID from your system to synchronize two sides.IMPORTANT If you use sourceId and customerSourceId at the same time, sourceId will have higher priority.

cac

optional
object null

An object that contains comprehensive data regarding the cost of acquiring customers comprises of the value and currency." of the value and currency.

cac.value

required
float

CAC value in 'ENUM_STRING' format correspondingly.

cac.currency

required
string

(EUR, USD)
IMPORTANT Please use only latin uppercase format. No numbers or other symbols allowed.

Response

                                        {
  "result": true,
  "requestId":" 5d915c22d132d5f45a4e38b8",
  "errors": []
}
                                    

Parameters

Title Type Description

result

boolean

The value indicates that the contact was successfully added/updated to your contact list:

  • true: Contact was successfully added/updated.

requestId

string

Unique request ID to be used to match the specific “Update contact” request with the Status Webhook, which will be sent by Wooxy after the request is processed.

Method Errors

                                        {
   "result": false,
   "requestId": "REQUEST_ID",
   "errors": [
      "Error description text"
   ]
}
                                    
Error

“Argument contactListId must be a non-empty string”

“Argument upsert must be a true or false”

“Argument webHookUri must be a valid URI”

“add at least one valid contact to contacts field”

“Argument contact must be a non-empty string filled with valid email, phoneNumber or userId”

“Argument name must be a string”

“invalid RFC2822 email {email} at email field”

“Argument email must be a string”

“Argument phoneNumber must be a string”

“{phoneNumber} is not a valid E.164 phone number”

“Argument userId must be a string”

"Argument userId must be less than 125 symbols"

“Argument active can be true or false”

“Argument emailSubscribe can be true or false”

“Argument smsSubscribe can be true or false”

“Argument desktopWebPushSubscribe can be true or false”

“Argument mobileWebPushSubscribe can be true or false”

“Argument firstName must be a string”

“Argument firstName must be a string with max length within 255 characters”

“Argument lastName must be a string”

“Argument lastName must be a string with max length within 255 characters”

"Argument birthday must be a YYYY-MM-DD date”

“Argument language must be a valid ISO language”

“Unknown gender value”

“Argument timezone must be a valid timezone string”

“Argument score must have a numeric value”

“Argument avatarLink must be a valid URL”

“Argument facebookLink must be a valid URL”

“Argument instagramLink must be a valid URL”

“Argument linkedInLink must be a valid URL”

“Argument twitterLink must be a valid URL”

“Argument tiktokLink must be a valid URL”

“Argument variables must be an array of arrays with \”name\” and \”value\ “fields”

“name of variable must be a string”

“name of variable can not be empty”

“variable \”{name}\” is reserved and can not be added as custom variable”

“invalid name of variable {name}”

“List with id {contactListId} not found!”

“email, phoneNumber or externalId\/userId must be filled at contact position {i}”

“Variable {name} type is date, but value is not valid date. Value {value}”

“Variable {name} not found in list. Try to add it first”

“Request saving error. Please, contact us or try again later”

“Invalid authorization token!”

“Internal server error”

“Bad Request”

“no matches found for access token {accessToken}”

“user {id} not enabled”

“no data found for key {userId}”

“access token check failed for key\/secret $key\/$accessToken”

“Argument {argument} required”

“Argument sourceId must be a string”

“sourceId {sourceId} not found in your account at contact position {i}”

“Argument customerSourceId must be a string”

“Argument customerSourceId must be an alphanumeric string with max length within 40 characters”

“Argument CAC must be an array with value and currency fields”

“CAC value must be a positive float”

“CAC currency {currency} not allowed. USD, EUR are”

Code Examples

PHP
                $accessToken = "YOUR_API_KEY";
$url         = 'https://api.wooxy.com/v3/contacts/update';

$body = json_encode([
    'contactListId' => 'YOUR_CONTACT_LIST_ID',
    'webHookUri'    => 'YOUR_WEBHOOK_URL',
    'upsert'        => false,
    'contacts'      => [
        [
            "contact"        => "+15555555",
            "name"           => "John Doe",
            "email"          => "user@example.com",
            "phoneNumber"    => "+15555555",
            "userId"         => "myUserId",
            "active"         => true,
            "emailSubscribe" => true,
            "smsSubscribe"   => true,
            "desktopWebPushSubscribe"=> true, 
            "mobileWebPushSubscribe"=> true, 
            "telegramSubscribe"=> true,
            "viberSubscribe"=> true,
            "firstName"      => "John", 
            "lastName"       => "Doe", 
            "contactBirthday"=> "1990-01-01", 
            "contactLanguage"=> "en", 
            "contactGender " => 2, 
            "contactTimezone"=> "Europe/Tallinn", 
            "contactScore"   => 100, 
            "avatarLink"     => "https://img.wooxy.com/g/06c38b4568.jpg", 
            "facebookLink"   => "https://facebook.com/wooxy.com", 
            "instagramLink"  => "https://instagram.com/wooxy", 
            "linkedInLink"   => "https://linkedin.com/company/wooxy", 
            "twitterLink"    => "https://twitter.com/wooxy", 
            "tiktokLink"     => "https://tiktok.com/wooxy", 
            "sourceId"       => "5efc8503efeef96ca3151931", 
            "customerSourceId"=> "mySourceID",
            "sourceId"       => "5efc8503efeef96ca3151931",
            "customerSourceId" => "mySourceId",
            "cac"            => [
                  "value"    => "2.05", 
                  "currency" => "EUR",
                ],
            "variables"      => [
                [
                    "name"   => "newVariableName",
                    "value"  => "newVariableValue",
                ],
            ],
        ],
    ],
]);

/**
 * Request Example
 */
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Access-Token: $accessToken",
    'Content-Type: application/json',
    'Content-Length: ' . strlen($body),
]);

$result = curl_exec($ch);
if ($result === false) {
    echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
    echo strval($result) . PHP_EOL;
}
curl_close($ch);