Member_fields

Last updated:2022-12-28

Create

URL

https://email.api.engagelab.cc/v1/marketing/lists/fields
          https://email.api.engagelab.cc/v1/marketing/lists/fields

        
This code block in the floating window

HTTP request method

POST
          POST

        
This code block in the floating window

Content-Type

application/json; charset=utf-8
          application/json; charset=utf-8

        
This code block in the floating window

Request-Headers

Header Type Required Description
Authorization string true Basic base64(api_user:api_key)

Body-Parameters

Parameter Type Required Description
field_name string true Field name (maximum 64 characters, consisting of only a-z, A-Z, 0-9, _ and cannot be a system-defined field string; including system fields Email, Name, Phone, a total of 50 fields can be created)
field_type integer true Field type (0: text, 1: number, 2: date, 3: birthday, 4: dropdown)
visible boolean true Whether it is visible, true or false
format string false Data format:
0 or .0 or .00 (when field_type=1);
MM/DD/YYYY or DD/MM/YYYY (when field_type=2);
MM/DD or DD/MM (when field_type=3)
options string[] false List of items for dropdown type, cannot be empty when field_type is dropdown, maximum of 10 data items

Note:

  1. System fields: Email, Name, Phone, Tag, Campaign, Segment, Domain, CreateTime, UpdateTime, UnsubscribeTime.
  2. Field names cannot be system fields, and changing the letter case is also not allowed for creating them.

Request-Example

curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields --data '{ "field_name": "xiao", "field_type": 3, "visible": true, "format": "MM/DD" }'
          curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields --data '{
  "field_name": "xiao",
  "field_type": 3,
  "visible": true,
  "format": "MM/DD"
}'

        
This code block in the floating window

Response-Success

HttpStatus: 200

{ "result": { "field_id": 11, "field_name": "xiao", "field_type": 3, "visible": true, "format": "MM/DD" } }
          { 
 "result": {
   "field_id": 11,
  "field_name": "xiao",
  "field_type": 3,
  "visible": true,
  "format": "MM/DD"
  }
}

        
This code block in the floating window

Response-Error

HTTP Status :401

{ "code": 30000, "message": "Authentication failed" }
          {
  "code": 30000,
  "message": "Authentication failed"
}

        
This code block in the floating window

Delete

URL

https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}
          https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}

        
This code block in the floating window

HTTP request method

DELETE
          DELETE

        
This code block in the floating window

Content-Type

application/x-www-form-urlencoded;charset=utf-8
          application/x-www-form-urlencoded;charset=utf-8

        
This code block in the floating window

Request-Headers

Header Type Required Description
Authorization string true Basic base64(api_user:api_key)

Request-Example

curl -X DELETE -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields/569
          curl -X DELETE -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields/569

        
This code block in the floating window

Response example

Response-Success

HttpStatus: 200

{ "count": 1 }
          {
    "count": 1
}

        
This code block in the floating window

Response-Error

{ "code": 30037, "message": "delete failure" }
          {
  "code": 30037,
  "message": "delete failure"
}

        
This code block in the floating window

Update

URL

https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}
          https://email.api.engagelab.cc/v1/marketing/lists/fields/{field_id}

        
This code block in the floating window

HTTP request method

PUT
          PUT

        
This code block in the floating window

Content-Type

application/json; charset=utf-8
          application/json; charset=utf-8

        
This code block in the floating window

Request-Headers

Header Type Required Description
Authorization string true Basic base64(api_user:api_key)

Body-Parameters

Parameter Type Required Description
field_name string true Field name (maximum 64 characters, consisting only of a-z, A-Z, 0-9, _, and cannot be a system-defined field string (ignoring case); a total of 50 fields can be created, including system fields Email, Name, Phone)
field_type integer true Field type (0: text, 1: number, 2: date, 3: birthday, 4: dropdown)
visible boolean true Whether it is visible, true or false
format string false Data format:
0 or .0 or .00 (fieldType=1);
MM/DD/YYYY or DD/MM/YYYY (fieldType=2);
MM/DD or DD/MM (fieldType=3)
options string[] false Contents of dropdown list items for dropdown type; must not be empty when field_type is dropdown, and can have a maximum of 10 data entries.

Note:

  1. System fields:Email、Name、Phone、tag、campaign、segment、domain、createTime、updateTime、unsubscribeTime

Request-Example

curl -X PUT -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields/839 --data '{ "field_name": "xiao", "field_type": 3, "visible": true, "format": "MM/DD" }'
          curl -X PUT -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields/839 --data '{
  "field_name": "xiao",
  "field_type": 3,
  "visible": true,
  "format": "MM/DD"
}'

        
This code block in the floating window

Response example

Response-Success

HttpStatus: 200

{ "count": 1 }
          {
  "count": 1
}

        
This code block in the floating window

Response-Error

{ "code": 30036, "message": "not found" }
          {
    "code": 30036,
    "message": "not found"
}

        
This code block in the floating window

Field list

URL

https://email.api.engagelab.cc/v1/marketing/lists/fields
          https://email.api.engagelab.cc/v1/marketing/lists/fields

        
This code block in the floating window

HTTP request method

GET
          GET

        
This code block in the floating window

Content-Type

application/x-www-form-urlencoded;charset=utf-8
          application/x-www-form-urlencoded;charset=utf-8

        
This code block in the floating window

Request-Headers

Header Type Required Description
Authorization string true Basic base64(api_user:api_key)

Query-Parameters

Parameter Type Required Description
field_name string false Field name, fuzzy query

Request-Example

curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields?field_name=Age
          curl -X GET -H 'Authorization:Basic YXBpX3VzZXI6YXBpX2tleQ==' -i https://email.api.engagelab.cc/v1/marketing/lists/fields?field_name=Age

        
This code block in the floating window

Response-Parameters

Parameter Type Description
result array[object] Field List
field_name string Field name (up to 64 characters, composed only of a-z, A-Z, 0-9, _, and cannot be a system-defined field string (case-insensitive); a total of 50 fields can be created, including system fields such as Email, Name, Phone)
field_type integer Field type (0: text, 1: number, 2: date, 3: birthday, 4: dropdown)
visible boolean Visibility (true or false)
format string Data format:
0 or .0 or .00 (fieldType=1);
MM/DD/YYYY or DD/MM/YYYY (field_type=2);
MM/DD or DD/MM (field_type=3)
options string[] Dropdown list content for dropdown type, should not be empty when field_type is dropdown, maximum of 10 data entries
field_id integer Index corresponding to the field, -1 indicates a system field
total integer Total number of records matching the query
count integer Number of records matching the query in this query result

Response example

Response-Success

HttpStatus: 200

{ "result": [ { "field_name": "Email", "field_type": 0, "visible": true, "format": null, "options": null, "field_id": -1 }, { "field_name": "Name", "field_type": 0, "visible": true, "format": null, "options": null, "field_id": -1 }, { "field_name": "Phone", "field_type": 0, "visible": true, "format": null, "options": null, "field_id": -1 }, { "field_name": "Gender", "field_type": 0, "visible": true, "format": null, "options": null, "field_id": 0 }, { "field_name": "Birthday", "field_type": 3, "visible": true, "format": "MM/DD", "options": null, "field_id": 1 }, { "field_name": "Age", "field_type": 1, "visible": true, "format": "0", "options": null, "field_id": 2 }, { "field_name": "remark", "field_type": 0, "visible": true, "format": null, "options": null, "field_id": 3 } ], "total": 7, "count": 7 }
          {
  "result": [
    {
      "field_name": "Email",
      "field_type": 0,
      "visible": true,
      "format": null,
      "options": null,
      "field_id": -1
    },
    {
      "field_name": "Name",
      "field_type": 0,
      "visible": true,
      "format": null,
      "options": null,
      "field_id": -1
    },
    {
      "field_name": "Phone",
      "field_type": 0,
      "visible": true,
      "format": null,
      "options": null,
      "field_id": -1
    },
    {
      "field_name": "Gender",
      "field_type": 0,
      "visible": true,
      "format": null,
      "options": null,
      "field_id": 0
    },
    {
      "field_name": "Birthday",
      "field_type": 3,
      "visible": true,
      "format": "MM/DD",
      "options": null,
      "field_id": 1
    },
    {
      "field_name": "Age",
      "field_type": 1,
      "visible": true,
      "format": "0",
      "options": null,
      "field_id": 2
    },
    {
      "field_name": "remark",
      "field_type": 0,
      "visible": true,
      "format": null,
      "options": null,
      "field_id": 3
    }
  ],
  "total": 7,
  "count": 7
}

        
This code block in the floating window

Response-Error

HTTP Status :401

{ "code": 30000, "message": "Authentication failed" }
          {
  "code": 30000,
  "message": "Authentication failed"
}

        
This code block in the floating window
在文档中心打开
icon
Contact Sales