Request task panel view in H5 game

!!! Note: This method is only suitable for H5 games embedded in UMIVERSE through Iframe and launched in the UMIVERSE experience webpage. It is not supported under your separate domain name.

Divepoint Collection Request Parameters:

{
    "merchantId":"1",//String Merchant Number: The merchant number assigned to you by the platform
    "ts":1699243390,//Number Request timestamp: used to ensure the uniqueness and security of the request
    "sign":"xxxxxxxxxxxxxxx", //String Signs the request parameters to verify the legitimacy of the request
}

Signature Method: Follow the sequence provided in the documentation (excluding ts and sign), concatenate the corresponding parameter values into a string, append ts and UMI-API-KEY (provided by us) at the end, and then generate the signature using MD5.

Signature String

const text = `${merchantId}${ts}${KEY}`;

Javascript Example:

// Signature Example
const KEY = "UMIVERSE UMI-API-KEY";
let str = '';
// Iterate through the parameter object
for (const key in param) {
    if (param.hasOwnProperty(key)) {
        const value = param[key];
        // Concatenate the parameter values into the string
        str += `${value}`;
    }
}
// Append the timestamp and secret key to the end of the string
str += `${ts}${KEY}`;
// Calculate the MD5 hash value
const sign = md5(str);

Here’s a complete example of a signature generation and API request process using JavaScript. This includes the creation of the signature, appending it to the request, and making an API call::

Last updated