联系人
获得联系人列表
您帐户下的联系人的返回列表。
GET /api/2.0/contacts
举例:
# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';
# Instantiate the client.
$jmClient = new JoomagREST(
'api_de81b9eb3ff797796edc0cd00020b6c8',
'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);
# Make the call to the client.
$result = $jmClient->getContactsList();
回复:
{
"error": 0,
"message": "OK",
"data": [
{
"email": "john@example.com"
},
{
"email": "ketty@example.com"
},
{
"email": "baz@example.com"
},
{
"email": "foo@example.com"
}
]
}
创建联系人
在帐户中创建联系人。
POST /api/2.0/contacts
参数 | 类型 | 解释 |
---|---|---|
字符串 | 联系人的电子邮件地址 | |
full_name | 字符串 | 联系人的全名 |
country | 字符串 | 联系人的国家/地区 |
city | 字符串 | 城市地址 |
street | 字符串 | 街道 |
zip | 字符串 | 合同邮政编码 |
举例:
# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';
# Instantiate the client.
$jmClient = new JoomagREST(
'api_de81b9eb3ff797796edc0cd00020b6c8',
'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);
# Make the call to the client.
$result = $jmClient->post( "contacts", array(
"email" => "john@example.com",
"full_name" => "John Smith",
"country" => "US",
"city" => "New York",
"street" => "2250 Lexington Avenue",
"zip" => "10035"
) );
回复:
{
"error": 0,
"message": "OK",
"data": {
"email": "john@example.com"
}
}
发送单刊
将一份出版物发送给特定的联系人。
POST /api/2.0/contacts/<email>/issue/<issue_id>
举例:
# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';
# Instantiate the client.
$jmClient = new JoomagREST(
'api_de81b9eb3ff797796edc0cd00020b6c8',
'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);
# Subscriber email
$email = 'john@example.com';
# ID of the issue
$issueID = '0980693001409324380';
# Make the call to the client.
$result = $jmClient->post( "contacts/$email/issue/$issueID" );
回复:
{
"error": 0,
"message": "OK",
"data": []
}
发送杂志订阅
向指定联系人交付订阅的杂志。
POST /api/2.0/contacts/<email>/subscription/<magazine_id>
参数 | 类型 | 解释 |
---|---|---|
cycle | int | 杂志的订阅周期。必须仅在提供付费订阅时发送。可以有以下值:
|
举例:
# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';
# Instantiate the client.
$jmClient = new JoomagREST(
'api_de81b9eb3ff797796edc0cd00020b6c8',
'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);
# Subscriber email
$email = 'john@example.com';
# ID of the magazine
$magazineID = 'M0166830001409317679';
# Make the call to the client.
$result = $jmClient->post( "contacts/$email/subscription/$magazineID" );
回复:
{
"error": 0,
"message": "OK",
"data": []
}
访问权限
提供对付费问题的指定联系人的访问权限或将隐私选项设置为“仅我选择的人员”的任何问题
PUT /api/2.0/contacts/<email>/access/<issue_id>
notify_user | 布尔值 | 布尔标志,指示是否应通过电子邮件通知用户;应该具有no或yes的值 |
举例:
# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';
# Instantiate the client.
$jmClient = new JoomagREST(
'api_de81b9eb3ff797796edc0cd00020b6c8',
'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);
# Subscriber email
$email = 'john@example.com';
# ID of the issue
$issueID = '0980693001409324380';
# Make the call to the client.
$result = $jmClient->put( "contacts/$email/access/$issueID", array(
'notify_user' => 'yes'
));
回复:
{
"error": 0,
"message": "OK",
"data": []
}
访问撤消
撤消指定联系人对以前与他/她手动或通过广告系列共享的问题的访问权限
DELETE /api/2.0/contacts/<email>/access/<issue_id>
notify_user | 布尔值 | 布尔标志,指示是否应通过电子邮件通知用户;应该具有no或yes的值 |
举例:
# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';
# Instantiate the client.
$jmClient = new JoomagREST(
'api_de81b9eb3ff797796edc0cd00020b6c8',
'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);
# Subscriber email
$email = 'john@example.com';
# ID of the issue
$issueID = '0980693001409324380';
# Make the call to the client.
$result = $jmClient->delete( "contacts/$email/access/$issueID", array(
'notify_user' => 'yes'
));
回复:
{
"error": 0,
"message": "OK",
"data": []
}
删除联系人
删除请求的联系人。
DELETE /api/2.0/contacts/<email>
举例:
# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';
# Instantiate the client.
$jmClient = new JoomagREST(
'api_de81b9eb3ff797796edc0cd00020b6c8',
'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);
# Subscriber email
$email = 'john@example.com';
# Make the call to the client.
$result = $jmClient->deleteContact( $email );
回复:
{
"error": 0,
"message": "OK",
"data": []
}