Skip to content

Latest commit

 

History

History
449 lines (305 loc) · 12.8 KB

File metadata and controls

449 lines (305 loc) · 12.8 KB

Zernio\ContactsApi

Cross-platform contact management (CRM). Contacts are unified identities linked to platform-specific channels (phone, IGSID, etc.). Created automatically when messages arrive, or manually via API.

All URIs are relative to https://zernio.com/api, except if the operation defines another base path.

Method HTTP request Description
bulkCreateContacts() POST /v1/contacts/bulk Bulk create contacts
createContact() POST /v1/contacts Create contact
deleteContact() DELETE /v1/contacts/{contactId} Delete contact
getContact() GET /v1/contacts/{contactId} Get contact
getContactChannels() GET /v1/contacts/{contactId}/channels List channels for a contact
listContacts() GET /v1/contacts List contacts
updateContact() PATCH /v1/contacts/{contactId} Update contact

bulkCreateContacts()

bulkCreateContacts($bulk_create_contacts_request): \Zernio\Model\BulkCreateContacts200Response

Bulk create contacts

Import up to 1000 contacts at a time. Skips duplicates.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\ContactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$bulk_create_contacts_request = new \Zernio\Model\BulkCreateContactsRequest(); // \Zernio\Model\BulkCreateContactsRequest

try {
    $result = $apiInstance->bulkCreateContacts($bulk_create_contacts_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactsApi->bulkCreateContacts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
bulk_create_contacts_request \Zernio\Model\BulkCreateContactsRequest

Return type

\Zernio\Model\BulkCreateContacts200Response

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createContact()

createContact($create_contact_request): \Zernio\Model\CreateContact200Response

Create contact

Create a new contact. Optionally create a platform channel in the same request by providing accountId, platform, and platformIdentifier.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\ContactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$create_contact_request = new \Zernio\Model\CreateContactRequest(); // \Zernio\Model\CreateContactRequest

try {
    $result = $apiInstance->createContact($create_contact_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_contact_request \Zernio\Model\CreateContactRequest

Return type

\Zernio\Model\CreateContact200Response

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteContact()

deleteContact($contact_id)

Delete contact

Permanently deletes a contact and all associated channels.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\ContactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$contact_id = 'contact_id_example'; // string

try {
    $apiInstance->deleteContact($contact_id);
} catch (Exception $e) {
    echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contact_id string

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getContact()

getContact($contact_id): \Zernio\Model\GetContact200Response

Get contact

Returns a contact with all associated messaging channels.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\ContactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$contact_id = 'contact_id_example'; // string

try {
    $result = $apiInstance->getContact($contact_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactsApi->getContact: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contact_id string

Return type

\Zernio\Model\GetContact200Response

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getContactChannels()

getContactChannels($contact_id): \Zernio\Model\GetContactChannels200Response

List channels for a contact

Returns all messaging channels linked to a contact (e.g. Instagram DM, Telegram, WhatsApp).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\ContactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$contact_id = 'contact_id_example'; // string

try {
    $result = $apiInstance->getContactChannels($contact_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactsApi->getContactChannels: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contact_id string

Return type

\Zernio\Model\GetContactChannels200Response

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listContacts()

listContacts($profile_id, $search, $tag, $platform, $is_subscribed, $limit, $skip): \Zernio\Model\ListContacts200Response

List contacts

List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and full-text search.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\ContactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$profile_id = 'profile_id_example'; // string | Filter by profile. Omit to list across all profiles
$search = 'search_example'; // string
$tag = 'tag_example'; // string
$platform = 'platform_example'; // string
$is_subscribed = 'is_subscribed_example'; // string
$limit = 50; // int
$skip = 0; // int

try {
    $result = $apiInstance->listContacts($profile_id, $search, $tag, $platform, $is_subscribed, $limit, $skip);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactsApi->listContacts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
profile_id string Filter by profile. Omit to list across all profiles [optional]
search string [optional]
tag string [optional]
platform string [optional]
is_subscribed string [optional]
limit int [optional] [default to 50]
skip int [optional] [default to 0]

Return type

\Zernio\Model\ListContacts200Response

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateContact()

updateContact($contact_id, $update_contact_request): \Zernio\Model\UpdateContact200Response

Update contact

Update one or more fields on a contact. Only provided fields are changed.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\ContactsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$contact_id = 'contact_id_example'; // string
$update_contact_request = new \Zernio\Model\UpdateContactRequest(); // \Zernio\Model\UpdateContactRequest

try {
    $result = $apiInstance->updateContact($contact_id, $update_contact_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contact_id string
update_contact_request \Zernio\Model\UpdateContactRequest [optional]

Return type

\Zernio\Model\UpdateContact200Response

Authorization

bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]