notiss/communication

与 Notiss 通信实例 API 交互

1.0.1 2022-11-13 12:56 UTC

This package is auto-updated.

Last update: 2024-09-13 16:51:11 UTC


README

Notiss 通信 API 客户端

需求

要使用 Notiss 通信 API 客户端,需要以下条件

  • 获取 Notiss 通信账户
  • 获取 API 密钥
  • 现在您可以与 Notiss 通信 API 交互了

Composer 安装

迄今为止,安装 Notiss 通信 API 客户端最简单的方法是使用 Composer 进行要求。

$ composer require notiss/communication

{
    "require": {
        "notiss/communication": "^1.0"
    }
}

入门

初始化 Notiss 通信 API 客户端,并设置您的 API 密钥。

$notiss_com = new \Notiss\Communication\ApiClient("API_KEY_HERE","https://communication.notiss.nl/api/v1/connect/");

获取域名详情

$domain_details = $notiss_com->get('domain-details');

获取可以订阅的标签联系人

$tags = $notiss_com->tags->get();

获取所有标签

$tags = $notiss_com->tags->all();

订阅标签

您可以传递一个联系人数组以及/或一个组织。如果联系人以及/或组织不存在,则创建组织并将 optin 设置为 true。如果请求中传递了联系人以及/或组织,则电子邮件或手机属性是必需的。另外,还需要组织名称。空值将从请求中删除,并且不会被更新。

$contact = array(
    'title' => '',
    'firstname' => '',
    'lastname' => '',
    'gender' => '',
    'address' => '',
    'address2' => '',
    'zipcode' => '',
    'city' => '',
    'country' => '',
    'phone' => '',
    'mobile' => '',
    'email' => 'info@notiss.nl',
    'language' => '',
);

$organization = array(
    'creditor_nr' => '',
    'debitor_nr' => '',
    'name' => 'Notiss',
    'address' => '',
    'address2' => '',
    'zipcode' => '',
    'city' => '',
    'country' => '',
    'phone' => '',
    'mobile' => '',
    'fax' => '',
    'email' => 'info@notiss.nl',
    'website' => '',
    'coc' => '',
    'vat_number' => '',
    'iban_name' => '',
    'iban_number' => '',
    'swift_code' => '',
    'language' => '',
);

$data = array(
    'contact' => $contact,
    'organization' => $organization,
);
$tags = $notiss_com->tags->subscirbeToTag($tag_id, $data);

联系人

获取所有联系人

$notiss_com->contacts->all();

获取联系人

$notiss_com->contacts->get($contact_id);

创建联系人

$new_contact = array(
    'title' => '',
    'firstname' => '',
    'lastname' => '',
    'gender' => '',
    'address' => '',
    'address2' => '',
    'zipcode' => '',
    'city' => '',
    'country' => '',
    'phone' => '',
    'mobile' => '',
    'email' => 'info@notiss.nl',
    'language' => '',
);
$notiss_com->contacts->create($new_contact);

更新联系人

$contact_id = 1;
$contact = array(
    'title' => '',
    'firstname' => '',
    'lastname' => '',
    'gender' => '',
    'address' => '',
    'address2' => '',
    'zipcode' => '',
    'city' => '',
    'country' => '',
    'phone' => '',
    'mobile' => '',
    'email' => 'info@notiss.nl',
    'language' => '',
);
$notiss_com->contacts->update($contact_id, $contact);

删除联系人

$notiss_com->contacts->delete($contact_id);

组织

获取所有组织

$notiss_com->organizations->all();

获取组织

$notiss_com->organizations->get($organization_id);

创建组织

$new_organization = array(
    'title' => '',
    'firstname' => '',
    'lastname' => '',
    'gender' => '',
    'address' => '',
    'address2' => '',
    'zipcode' => '',
    'city' => '',
    'country' => '',
    'phone' => '',
    'mobile' => '',
    'email' => 'info@notiss.nl',
    'language' => '',
);
$notiss_com->organizations->create($new_organization);

更新组织

$organization_id = 1;
$organization = array(
    'title' => '',
    'firstname' => '',
    'lastname' => '',
    'gender' => '',
    'address' => '',
    'address2' => '',
    'zipcode' => '',
    'city' => '',
    'country' => '',
    'phone' => '',
    'mobile' => '',
    'email' => 'info@notiss.nl',
    'language' => '',
);
$notiss_com->organizations->update($organization_id, $organization);

删除组织

$notiss_com->organizations->delete($organization_id);

使用覆盖订阅标签

与订阅标签端点做同样的事,空值会清除联系人或组织的属性(如果设置了)。

支持

联系: www.notiss.nl — development@notiss.nl — +31 85 40 11 397