# 属性管理
# 创建属性
URL:
https://api2.sendcloud.net/marketing/lists/fields
1
Method: POST
Content-Type: application/json; charset=utf-8
Request-Headers:
| Header | Type | Required | Description | 
|---|---|---|---|
| Authorization | string | true | Bearer Token | 
Body-Parameters:
| Parameter | Type | Required | Description | 
|---|---|---|---|
| fieldName | string | true | 字段名(最长64个字符,仅由 a-z,A-z,0-9,_ 等组成,且不能为系统定义属性字符串(忽略字母大小写);包含系统字段 Email、Name、Phone 在内一共可创建50个属性字段 | 
| fieldType | integer | true | 字段类型(0: text, 1: number, 2: date, 3: birthday, 4: dropdown) | 
| visible | boolean | true | 是否可见 true 或 false | 
| format | string | false | 数据格式: 0 或 .0 或 .00 (fieldType=1时); MM/DD/YYYY或DD/MM/YYYY (fieldType=2时); MM/DD或DD/MM (fieldType=3时) | 
| options | string[] | false | dropdown 类型的列表项内容,fieldType 为 dropdown 类型时不能为空,最多为10条数据 | 
说明:
- 系统属性:Email、Name、Phone、tag、campaign、segment、domain、createTime、updateTime、unsubscribeTime
- fieldName不能为系统属性,改变字母大小写也不允许创建
Request-Example:
curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/fields --data '{
  "fieldName": "xiao",
  "fieldType": 3,
  "visible": true,
  "format": "MM/DD"
}'
1
2
3
4
5
6
2
3
4
5
6
Response-Success:
HttpStatus: 201
Response:
{ 
  "fieldId": 11
}
1
2
3
2
3
Response-Error:
{
    "status":401,
    "error":{
        "parameter":"",
        "message":"Unauthorized"
    }
}
1
2
3
4
5
6
7
2
3
4
5
6
7
# 删除属性
URL:
https://api2.sendcloud.net/marketing/lists/fields/{fieldId}
1
Method: DELETE
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Request-Headers:
| Header | Type | Required | Description | 
|---|---|---|---|
| Authorization | string | true | Bearer Token | 
Path-parameters:
| Parameter | Type | Required | Description | 
|---|---|---|---|
| fieldId | integer | true | 属性 ID | 
Request-Example:
curl -X DELETE -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/fields/569
1
Response-Success:
HttpStatus: 204
Response:
{}
1
Response-Error:
{
    "status":401,
    "error":{
        "parameter":"",
        "message":"Unauthorized"
    }
}
1
2
3
4
5
6
7
2
3
4
5
6
7
# 更新属性
URL:
https://api2.sendcloud.net/marketing/lists/fields/{fieldId}
1
Method: PATCH
Content-Type: application/json; charset=utf-8
Request-Headers:
| Header | Type | Required | Description | 
|---|---|---|---|
| Authorization | string | true | Bearer Token | 
Path-parameters:
| Parameter | Type | Required | Description | 
|---|---|---|---|
| fieldId | integer | true | 属性 ID | 
Body-Parameters:
| Parameter | Type | Required | Description | 
|---|---|---|---|
| fieldName | string | true | 字段名(最长64个字符,仅由 a-z,A-z,0-9,_ 等组成,且不能为系统定义属性字符串(忽略字母大小写);包含系统字段 Email、Name、Phone 在内一共可创建50个属性字段 | 
| fieldType | integer | true | 字段类型(0: text, 1: number, 2: date, 3: birthday, 4: dropdown) | 
| visible | boolean | true | 是否可见 true 或 false | 
| format | string | false | 数据格式: 0 或 .0 或 .00 (fieldType=1时); MM/DD/YYYY或DD/MM/YYYY (fieldType=2时); MM/DD或DD/MM (fieldType=3时) | 
| options | string[] | false | dropdown 类型的列表项内容,fieldType 为 dropdown 类型时不能为空,最多为10条数据 | 
说明:
- 系统属性:Email、Name、Phone、tag、campaign、segment、domain、createTime、updateTime、unsubscribeTime
Request-Example:
curl -X PATCH -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/fields/839 --data '{
  "fieldName": "xiao",
  "fieldType": 3,
  "visible": true,
  "format": "MM/DD"
}'
1
2
3
4
5
6
2
3
4
5
6
Response-Success:
HttpStatus: 200
Response
{
  "fieldId": 4,
  "fieldName": "update2Birthday",
  "fieldType": 3,
  "visible": true,
  "format": "MM/DD",
  "options": null
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Response-Error:
{
    "status":401,
    "error":{
        "parameter":"",
        "message":"Unauthorized"
    }
}
1
2
3
4
5
6
7
2
3
4
5
6
7
# 属性列表
URL:
https://api2.sendcloud.net/marketing/lists/fields
1
Method: GET
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Request-Headers:
| Header | Type | Required | Description | 
|---|---|---|---|
| Authorization | string | true | Bearer Token | 
Query-Parameters:
| Parameter | Type | Required | Description | 
|---|---|---|---|
| fieldName | string | false | 字段名称,模糊查询 | 
Request-Example:
curl -X GET -H 'Authorization:Bearer YXBpX3VzZXI6YXBpX2tleQ==' -i https://api2.sendcloud.net/marketing/lists/fields?fieldName=Age
1
Response-Parameters:
| Parameter | Type | Description | 
|---|---|---|
| list | object[] | 属性列表 | 
| fieldName | string | 字段名(最长64个字符,仅由 a-z,A-z,0-9,_ 等组成,且不能为系统定义属性字符串(忽略字母大小写);包含系统字段 Email、Name、Phone 在内一共可创建50个属性字段 | 
| fieldType | integer | 字段类型(0: text, 1: number, 2: date, 3: birthday, 4: dropdown) | 
| visible | boolean | 是否可见 true 或 false | 
| format | string | 数据格式: 0 或 .0 或 .00 (fieldType=1时); MM/DD/YYYY或DD/MM/YYYY (fieldType=2时); MM/DD或DD/MM (fieldType=3时) | 
| options | string[] | dropdown 类型的列表项内容,fieldType 为 dropdown 类型时不能为空,最多为10条数据 | 
| fieldId | integer | 属性对应的idx ,-1则表示系统属性 | 
| total | integer | 本次查询符合条件的记录总数 | 
Response-Success:
HttpStatus: 200
Response
{
    "list": [
        {
            "fieldName": "Email",
            "fieldType": 0,
            "visible": true,
            "format": null,
            "options": null,
            "fieldId": -1
        },
        {
            "fieldName": "Name",
            "fieldType": 0,
            "visible": true,
            "format": null,
            "options": null,
            "fieldId": -1
        },
        {
            "fieldName": "Phone",
            "fieldType": 0,
            "visible": true,
            "format": null,
            "options": null,
            "fieldId": -1
        },
        {
            "fieldName": "Gender",
            "fieldType": 0,
            "visible": true,
            "format": null,
            "options": null,
            "fieldId": 0
        },
        {
            "fieldName": "Birthday",
            "fieldType": 3,
            "visible": true,
            "format": "MM/DD",
            "options": null,
            "fieldId": 1
        },
        {
            "fieldName": "Age",
            "fieldType": 1,
            "visible": true,
            "format": "0",
            "options": null,
            "fieldId": 2
        }
    ],
    "total": 6
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Response-Error:
{
    "status":401,
    "error":{
        "parameter":"",
        "message":"Unauthorized"
    }
}
1
2
3
4
5
6
7
2
3
4
5
6
7
