Point Groups
Note
此页面的内容需要进行重大更新。旧页面包含过时且可能不准确的信息。您仍然可以访问它,具体请参见 Mautic Developer Documentation archived repository。
如果您有兴趣帮助开发此页面和其他新内容的文档,请考虑加入我们的文档工作组。
请阅读 Contributing Guidelines 和 Contributing to Mautic’s documentation 以开始您的贡献。
使用此端点来管理 Mautic 中的联系方式分组。
<?php
use Mautic\MauticApi;
use Mautic\Auth\ApiAuth;
// ...
$initAuth = new ApiAuth();
$auth = $initAuth->newAuth($settings);
$apiUrl = "https://your-mautic.com";
$api = new MauticApi();
$pointGroupApi = $api->newApi("pointGroups", $auth, $apiUrl);
Get Point Group
<?php
//...
$pointGroup = $pointGroupApi->get($id);
"pointGroup": {
"id": 47,
"name": "Group A",
"description": "This is my first Point Group created via API.",
"isPublished": true,
"dateAdded": "2024-02-29T12:17:52+00:00",
"dateModified": null,
"createdBy": 2,
"createdByUser": "Admin User",
"modifiedBy": null,
"modifiedByUser": null,
}
获取单个 ID 的联系方式分组。
HTTP 请求
GET /points/groups/ID
响应
预期响应代码: 200
请参见 JSON 代码示例。
联系方式分组属性
名称 |
类型 |
描述 |
|---|---|---|
|
int |
联系方式分组的 ID |
|
|
联系方式分组名称 |
|
|
联系方式分组描述 |
|
|
是否已发布联系方式分组 |
|
|
创建联系方式分组的日期/时间 |
|
|
创建联系方式分组的用户 ID |
|
|
创建联系方式分组用户的姓名 |
|
|
最后修改联系方式分组的日期/时间 |
|
|
最后修改联系方式分组的用户 ID |
|
|
最后修改联系方式分组用户的姓名 |
列出联系方式分组
<?php
//...
$pointGroups = $pointGroupApi->getList($searchFilter, $start, $limit, $orderBy, $orderByDir, $publishedOnly, $minimal);
“total”: 4, “pointGroups”: [
- {
“id”: 47, “name”: “Group A”, “description”: “This is my first Point Group created via API.”, “isPublished”: true, “dateAdded”: “2024-02-29T12:17:52+00:00”, “dateModified”: null, “createdBy”: 2, “createdByUser”: “Admin User”, “modifiedBy”: null, “modifiedByUser”: null
]
}
HTTP Request
GET /points/groups
Response
Expected Response Code: 200
See JSON code example.
Point Group Properties
Name |
Type |
Description |
|---|---|---|
|
|
Count of all Point Groups |
|
|
ID of the Point Group |
|
|
Point Group name |
|
|
Point Group description |
|
|
Whether the Point Group is published |
|
|
Date/time Point Group was created |
|
|
ID of the User that created the Point Group |
|
|
Name of the User that created the Point Group |
|
|
Date/time Point Group was last modified |
|
|
ID of the User that last modified the Point Group |
|
|
Name of the User that last modified the Point Group |
Create Point Group
<?php
$data = [
'name' => 'Group A',
'description' => 'This is my first Point Group created via API.'
];
$pointGroup = $pointGroupApi->create($data);
HTTP Request
POST /points/groups/new
Post Parameters
Name |
Description |
|---|---|
name |
Point Group name is the only required field |
description |
A description of the Point Group. |
Response
Expected Response Code: 201
Properties
Same as Get Point Group.
Edit Point Group
<?php
$id = 1;
$data = [
'name' => 'New Point Group name',
'description' => 'Updated description of the Point Group.'
];
$pointGroup = $pointGroupApi->edit($id, $data);
HTTP Request
PATCH /points/groups/ID/edit
Post Parameters
Name |
Description |
|---|---|
name |
Point Group name is the only required field |
description |
A description of the Point Group. |
Response
Expected Response Code: 200
Properties
删除点组
<?php
$pointGroup = $pointGroupApi->delete($id);
删除一个点组。
HTTP 请求
DELETE /points/groups/ID/delete
响应
预期的响应代码: 200
属性
与 获取点组 相同。