Wooxy API v.3.0

Get add/update/remove request status

Get add/update/remove request status method allows you to obtain detailed information on the status of requests to methods Add New Contact, Update Contact, Remove Contact.

Important! Information about requests is stored in our system for no more than 7 days, after which we do not retain information about them.

Request

POST
https://api.wooxy.com/v3/request/find

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

Body Example

                                        {
   "ids" : [
      "YOUR_REQUEST_ID_1",
      "YOUR_REQUEST_ID_2",
      "YOUR_REQUEST_ID_3"
   ]
}
                                    

Parameters

Title Type Default Description

ids

required
array

List of request ID numbers. You can include only 100 IDs in one request.

Response

                                        {
   "result" : true,
   "requests" :{
      "YOUR_REQUEST_ID" : {
         "id" : "YOUR_REQUEST_ID",
         "source" : "REQUEST_SOURCE",
         "status" : "REQUEST_STATUS",
         "webHookUri" : "YOUR_WEBHOOK_URL",
         "createdAt" : "YYYY-MM-DD h:i:s",
         "updatedAt" : "YYYY-MM-DD h:i:s",
         "results" : {
            "errors" : [
               {
               "error" :"ERROR_CODE",
               "contact" :{
                     "id" :"WOOXY_CONTACT_ID",
                     "email" :"user@example.com",
                     "phone" :"+155555555",
                     "userId" :"myUserId-1"
                  },
             "humanError": "ERROR_DESCRIPTION"
               }
            ],
            "success" : [
               {
                  "id" : "WOOXY_CONTACT_ID",
                  "email" : "user-2@example.com",
                  "phone" : "+155555556",
                  "userId": "myUserId-2"
               }
            ]
         }
      }
  },
  "errors":[]
}
                                    

Parameters

Title Type Description

result

boolean

The request status:

  • true: Successful request;
  • false: Request failed.

requests

object

Full information regarding specific request

requests.YOUR_REQUEST_ID

object

Unique request ID returned by Wooxy in response to your request.

requests.YOUR_REQUEST_ID.id

string

Unique request ID returned by Wooxy in response to your request.

requests.YOUR_REQUEST_ID.source

string

API method used:

  • API_CREATE: Add a new contact;
  • API_UPDATE: Update contact data;
  • API_REMOVE: Remove a contact.

requests.YOUR_REQUEST_ID.status

string

Request current status code:

  • new: The request is accepted in processing;
  • done: The request was successfully processed;
  • fail: The request failed.

requests.YOUR_REQUEST_ID.webHookUri

string

Webhook URL included in the request where Wooxy tries to send a POST request with the status of the request
as soon as it is processed.

requests.YOUR_REQUEST_ID.createdAt

string

Request time in YYYY-MM-DD h:i:s format.

requests.YOUR_REQUEST_ID.updatedAt

string

Last time when the information regarding the request was updated in YYYY-MM-DD h:i:s format.

requests.YOUR_REQUEST_ID.results

object

An array of information regarding successful and/or failed contact management requests.

requests.YOUR_REQUEST_ID.results.errors

array

Errors for all failed requests with fail reason description.

requests.YOUR_REQUEST_ID.results.errors.error

string
  • ERR_EMPTY_IDENTIFIERS
  • ERR_CONTACT_EXISTS
  • ERR_CONTACT_DUPLICATION_ATTEMPT
  • ERR_SYSTEM_ERROR
  • ERR_CONTACT_NOT_EXISTS
  • ERR_INVALID_VARIABLE_NAME

requests.YOUR_REQUEST_ID.results.errors.contact

object

An array of contact information.

requests.YOUR_REQUEST_ID.results.errors.contact.id

string

Contact ID in Wooxy platform. For informational purposes only.

requests.YOUR_REQUEST_ID.results.errors.contact.email

string

Contact’s email address.

requests.YOUR_REQUEST_ID.results.errors.contact.phone

string

Contact’s phone number.

requests.YOUR_REQUEST_ID.results.errors.contact.userId

string

Contact’s unique userId from your platform.

requests.YOUR_REQUEST_ID.results.success

array

An array of contact information.

requests.YOUR_REQUEST_ID.results.success.id

string

Contact ID in Wooxy platform.
For informational purposes only.

requests.YOUR_REQUEST_ID.results.success.email

string

Contact’s email address.

requests.YOUR_REQUEST_ID.results.success.phone

string

Contact’s phone number.

requests.YOUR_REQUEST_ID.results.success.userId

string

Contact’s unique userId from your platform.

requests.YOUR_REQUEST_ID.results.errors.humanError

string

Text description of the error with a detailed description of the problem.

Method Errors

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

                                    
Error

“Argument ids must be an array of strings”

“Argument ids can not be empty”

“ids count must be less or equal 100”

“each id must be a non-empty string”

“No matches found”

“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”

Code Examples

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

$body = json_encode([
    'ids' => [
        'YOUR_REQUEST_ID_1',
        'YOUR_REQUEST_ID_2',
        'YOUR_REQUEST_ID_3'
    ],
]);

/**
 * 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);