Polyv Help Center

Help Center

Edit Information Collection

Updated: 2026-07-16 23:19:19

API Description

1、修改已有的信息采集配置(表单)
2、fields、privacyList 为整体覆盖,编辑已有字段须回传其 fieldKey
3、请求体参数不参与签名,签名仅使用URL参数(appId、timestamp)
4、接口支持https协议

API URL

http://api.polyv.net/live/v4/user/info-collection/form/update

Online API Call

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls have frequency limits. See details
  2. Please set the request header contentType:application/json

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See details for obtaining secret key
timestamp true Long Current 13-digit millisecond timestamp, valid within 3 minutes
sign true String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules

Request Body Parameter Description

The request body is a JSON object with the following fields:

Parameter Required Type Description
formId true Long Form ID
formName true String Information collection name, maximum 100 characters
privacyForceCheckEnabled false String Whether to force check the privacy agreement
Y: Yes
N: No
fields false Array Collection field definition list (full overwrite) See fields field description
privacyList false Array Privacy statement list (full overwrite), maximum 5 See privacyList field description

fields Field Description

Parameter Required Type Description
fieldType true String Field type
mobile: Phone number
name: Name
radio: Single choice
checkbox: Multiple choice
textarea: Question & answer
email: Email
text: Text box
number: Numeric text box
area: Region
upload: Image upload
tips: Tip
privacy: Privacy statement
fieldKey false String Unique field identifier. Must be returned as-is when editing an existing field; leave empty for new fields to be generated by the server
fieldName false String Field name, maximum 100 characters
rank true Integer Sort order, ascending
required false String Whether required
Y: Required
N: Optional
options false String Option values, used for single/multiple choice types
placeholder false String Placeholder text, maximum 255 characters
smsCheckEnabled false String Whether to enable SMS verification (for phone number type)
Y: Enable
N: Disable
areaCodeEnabled false String Whether to enable area code (for phone number type)
Y: Enable
N: Disable
chatNicknameEnabled false String Whether to sync as chat room nickname
Y: Enable
N: Disable
uploadMaxCount false Integer Maximum number of images to upload, used only for upload type, values 1/2/3

privacyList Field Description

Parameter Required Type Description
rank true Integer Sort order
title true String Title, maximum 200 characters
content false String Content
linkUrl false String Link URL, maximum 500 characters

Example

http://api.polyv.net/live/v4/user/info-collection/form/update?appId=xxx&sign=xxx&timestamp=xxx

Request body parameters:

{
    "formId": 52,
    "formName": "问卷调研V2",
    "privacyForceCheckEnabled": "N",
    "fields": [
        {
            "fieldType": "name",
            "fieldKey": "name_a1b2c3",
            "fieldName": "姓名",
            "rank": 1,
            "required": "Y"
        }
    ],
    "privacyList": []
}

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See global error description
status String Response status text
message String Response description, provides error details when code is 400 or 500
data Boolean Whether successful, true/false

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click here to download source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.

It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.

private static final Logger log = LoggerFactory.getLogger(LiveInteractionTest.class);
/**
 * 编辑信息采集
 * @throws IOException
 */
@Test
public void testUpdateInfoCollection() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId=super.appId;
    String appSecret=super.appSecret;
    String timestamp=String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/live/v4/user/info-collection/form/update";

    //签名仅使用URL参数,请求体不参与签名
    Map<String,String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp",timestamp);
    requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));

    String json = "{\"formId\":52,\"formName\":\"问卷调研V2\",\"privacyForceCheckEnabled\":\"N\",\"fields\":[{\"fieldType\":\"name\",\"fieldKey\":\"name_a1b2c3\",\"fieldName\":\"姓名\",\"rank\":1,\"required\":\"Y\"}],\"privacyList\":[]}";
    url = HttpUtil.appendUrl(url, requestMap);
    String response = HttpUtil.postJsonBody(url, json, null);

    log.info("测试编辑信息采集接口返回值:{}",response);
    //do somethings
}

Response Example

For global error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询