Polyv Help Center

Help Center

Reset Sub-Account Application Secret

Updated: 2022-09-21 18:29:03

Interface Description

1、重置分账号应用密匙
2、(timestamp, appId, sign)签名参数需通过url传递
3、接口支持https协议

Interface URL

http://api.polyv.net/live/v4/group/user/secret/reset

Request Method

POST

Interface Constraints

  1. The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls have frequency limits. See details

  2. For group account interface signature calculation, use the appId and appSecret of the primary group account.

  3. The application secret reset takes effect 5 minutes later.

Request Parameter Description

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

Example

http://api.polyv.net/live/v4/group/user/secret/reset?appId=ga1ayl6dh2&timestamp=1661443279000&sign=FD154894135E713FC2D0D64B2B33E72E&email=paasgrouptestpre01@polyv.net

Response Parameter Description

Parameter Type Description
code Integer Status code, same as HTTP status code, used to determine the basic response status
status String Response result, determined by business logic. Returns success on success, error on failure
success Boolean Whether the response was successful
requestId String Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic
error Object Error information when status code is not 200 See Error field description
data Object See data field description

Error Parameter Description

Parameter Type Description
code Integer Error code, used to determine the specific error reason
desc String Error description, corresponds to error.code

Data Parameter Description

Parameter Type Description
appId String Application ID
appSecret String Reset application Secret
userId String User global ID

Java Request Example

private static final Logger log = LoggerFactory.getLogger(GroupTestLive.class);
/**
 * 重置分账号应用密匙
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void groupSecretResetTest() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId = super.groupAppId;
    String appSecret = super.groupAppSecret;
    String timestamp = String.valueOf(System.currentTimeMillis());
    
    //业务参数
    String url = "http://api.polyv.net/live/v4/group/user/secret/reset";
    String email = "";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("email", email);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));

    url = HttpUtil.appendUrl(url, requestMap);
    String response = HttpUtil.postFormBody(url, null);
    log.info("测试重置分账号应用密匙成功:{}", response);
    //do somethings
}

Response Example

For system global error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "6c8c2d016ace4366a0d8fe2ff632ba28.72.16614432795402597",
    "data": {
        "appId": "gcx4zavev0",
        "appSecret": "50bxxxxxxxxxxxx68157635",
        "userId": "eaf4fead20"
    },
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "error": {
        "code": 10003,
        "desc": "时间戳过期"
    },
    "success": false
}
联系客服,在线咨询