VMOS Cloud API
  • 简体中文
  • English
  • 简体中文
  • English
  • Product Introduction
  • Product Type
  • Product Billing
  • OpenAPI
    • API Documentation
    • Error Code
    • Instance Property List
    • Android Device Modification Properties List
  • Android SDK
    • Example Construction
    • Interface Description
    • Callback Function
    • Error Code
    • Changelog
  • Web H5 SDK
    • Example Build
    • API description
    • Callback Functions
    • Error Code
    • Change log
  • Windows PC SDK
    • Example Setup
    • API Documentation
    • Callback Functions
    • Changelog
  • Edge-Cloud Communication Development
    • System service interface (aidl)
    • System Service API (AIDL)
  • Similar to XP, LSP Hook framework
  • Related agreements

Introduction

This document provides detailed API descriptions, syntax, parameter explanations, and examples, allowing you to manage cloud phone service resources through API calls.

Change Log

2025-05-21

  • Added Upload user image interface

2025-04-21

  • Updated Instance Restart (Restart to Change Network IP) interface

2025-04-09

  • Added Android image version collection interface
  • Added Cloud machine simulated touch interface

2025-03-29

  • Added Equipment Pre-sale Purchase interface
  • Added Query pre-sale order result details interface

2025-03-20

  • Added Query the list of countries supported by one-click new machine interface
  • Added Get real machine template by page interface
  • Updated One-Click New Device interface

2025-03-12

  • Updated Modify Contacts API
  • Added Modify instance wifi attributes API

2025-03-04

  • Added Switch Device API
  • Added Set keepalive application interface API

2025-02-27

  • Added File upload interface directly through link API

2025-02-26

  • Added Modify sim card information according to country code API

2025-02-20

  • Added Instance installed application list query API

2025-02-12

  • Updated Create Automated Task API Support adding video like and comment tasks

2025-02-08

  • Updated Instance File Upload Callback API
  • Updated Set Smart IP API
  • Updated Set Smart IP API
  • Added Equipment task execution result query API

2025-02-07

  • Updated Intelligent IP Proxy Check API

2025-02-06

  • Added Switch Root Permission API
  • Added Cloud Phone Status Example description
  • Optimized Automated Task Type Request Parameter description

2025-01-26

  • Added Query Instance Properties API
  • Added Batch Query Instance Properties API
  • Added Modify Instance Properties API
  • Updated Modify Contacts API
  • Added Modify Real Machine ADI Template API

2025-01-23

  • Added Intelligent IP Proxy Check API
  • Added Set Smart IP API
  • Added Cancel Intelligent IP API

2025-01-22

  • Added GET request to retrieve signature JAVA example demo

2025-01-21

  • Added SKU Package List API
  • Optimized Create Cloud Phone API to support renewal functionality

2025-01-16

  • Added Local Screenshot API
  • Added Get SDK Temporary Token by padCode API
  • Added Get SDK Temporary Token API
  • Added Clear SDK Authorization Token API
  • Added Upgrade Image API
  • Added Upgrade Real Machine Image API

2025-01-08

  • Added Automated Task List Query API
  • Added Create Automated Task API
  • Added Cancel Automated Task API
  • Added Retry Automated Task API
  • Added Application Details API

2025-01-07

  • Added Create Cloud Phone API
  • Added Cloud Phone List API
  • Added Cloud Phone Information Query API
  • Added Modify Instance Time Zone API
  • Added Modify Instance Language API
  • Added Set Instance Latitude/Longitude API
  • Added Uninstall App API
  • Added Start App API
  • Added Stop App API
  • Added Restart App API

2024-12-17

  • Added File Upload API
  • Added Instance File Upload API

2024-12-12

  • Added Instance Proxy Settings API
  • Added One-Click New Device API

2024-12-09

  • Added Modify Contacts API
  • Added Application Upload API
  • Added File Task Details API
  • Added Application Installation API

2024-12-09

  • Document Release

API Request Instructions

Prerequisites

Obtain the Access Key ID and Secret Access Key (AK/SK) of your account for API request authentication. Please contact the technical contact person to obtain them.

Common Request Parameters

Each API request must include the following four parameters in the Headers for authentication; otherwise, the API request will not work properly.

Parameter NameTypeExample ValueDescription
x-datestring20240301T093700ZThe timestamp of the request, in UTC, accurate to the second
x-hoststringopenapi.armcloud.netThe domain for accessing the API
authorizationstringHMAC-SHA256 Credential={AccessKey}, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature={Signature}The signature included in the request
Content-Typestringapplication/jsonThe MIME type of the resource

Authorization Signature Mechanism

For each HTTPS protocol request, the identity of the requester is verified based on the signature information in the request. This is achieved through encryption and validation using the AccessKey ID and AccessKey Secret (AK/SK) associated with the user account.

Manual Signature

Note

The signature requires a series of processing steps for the request parameters, including sorting, concatenation, and encryption. This method provides greater flexibility and customization, making it suitable for developers who have a deep understanding of the signature algorithm. However, manual signing requires developers to write additional code to implement the signing process, which may increase development complexity and the potential for errors. Therefore, we still recommend using the SDK to call the API and try to avoid writing signature code by hand. If you need to understand the principles and detailed process of signature calculation, you can refer to the following documentation.

The manual signature mechanism requires the requester to calculate the hash value of the request parameters, which is then encrypted and sent to the server along with the API request. The server will calculate the signature of the received request using the same mechanism and compare it with the signature provided by the requester. If the signature verification fails, the request will be rejected.

Obtain the Access Key ID and Secret Access Key (AK/SK) of your account for API request authentication. Please contact the technical contact person to obtain them.

Constructing the Canonical Request String (CanonicalRequest)
 String canonicalStringBuilder=
 	"host:"+*${host}*+"\n"+
 	"x-date:"+*${xDate}*+"\n"+
 	"content-type:"+*${contentType}*+"\n"+
 	"signedHeaders:"+*${signedHeaders}*+"\n"+
 	"x-content-sha256:"+*${xContentSha256}*;
FieldDescription
hostThe service domain of the request. Fixed to: api.vmoscloud.com
x-dateRefers to the UTC time of the request, which is the value of the X-Date header in the public parameters. It follows the ISO 8601 standard format: YYYYMMDD'T'HHMMSS'Z', for example: 20201103T104027Z
content-typeThe media type of the request or response body(application/json)
signedHeadersHeaders involved in signing. They correspond one-to-one with the CanonicalHeaders. The purpose is to specify which headers are involved in the signing calculation, thereby ignoring any extra headers added by a proxy. The headers host and x-date, if present, must be included.
Pseudocode example:
SignedHeaders=Lowercase(HeaderName0)+';'+Lowercase(HeaderName1)+";"+...+Lowercase(HeaderNameN)
Example:
SignedHeaders=content-type;host;x-content-sha256;x-date
x-content-sha256hashSHA256(body) Note: the body should be trimmed of spaces before calculating hashSHA256
Construct the string to be signed (StringToSign)

The signature string primarily contains metadata about the request and the canonicalized request. It consists of the signature algorithm, request date, credential, and the hash value of the canonicalized request.

To construct the StringToSign, the pseudocode is as follows:

StringToSign=
	Algorithm+'\n'+
	xDate+'\n'+
	CredentialScope+'\n'+
	hashSHA256(canonicalStringBuilder.getByte())
FieldDescription
AlgorithmRefers to the signature algorithm, currently only HMAC-SHA256 is supported.
x-dateRefers to the UTC time of the request, which is the value of the X-Date header in the public parameters. It follows the ISO 8601 standard format: YYYYMMDD'T'HHMMSS'Z', for example: 20201103T104027Z
CredentialScopeRefers to the credential, formatted as: ${YYYYMMDD}/${service}/request, where ${YYYYMMDD} is the date from X-Date, ${service} is fixed as armcloud-paas, and request is a fixed value.
See below for "Calculating CredentialScope"
CanonicalRequestRefers to the result of constructing the canonical request string.
                      |
Calculating CredentialScope
String credentialScope = shortXDate+"/"+service+"/request";
    shortXDate: Short request time (the first 8 digits of x-date, for example: 20201103)
    service: Service name (fixed as armcloud-paas)
    "/request": Fixed value
Signingkey Example

HMAC Hash Operation Sequence to Generate the Derived Signing Key

byte[]Signingkey=hmacSHA256(hmacSHA256(hmacSHA256(sk.getBytes(),shortXDate),service),”request”);
FieldDescription
skCustomer's secret key
shortXDateShort request date
ServiceService name, temporarily fixed as armcloud-paas

Signature Example

signature=HexEncode(hmacSHA256(Signingkey,StringToSign))

Signature Generation Utility Class Example (Java)

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;

public class PaasSignUtils {

    public static final String service = "armcloud-paas";

    public static String signature(String contentType, String signedHeaders, String host, String xDate, String sk, byte[] body) throws Exception {

        if (body == null) {
            body = new byte[0];
        }
        String xContentSha256 = hashSHA256(body);
        String shortXDate = xDate.substring(0, 8);

        String canonicalStringBuilder = "host:" + host + "\n" + "x-date:" + xDate + "\n" + "content-type:" + contentType + "\n" + "signedHeaders:" + signedHeaders + "\n" + "x-content-sha256:" + xContentSha256;

        String hashcanonicalString = hashSHA256(canonicalStringBuilder.getBytes());

        String credentialScope = shortXDate + "/" + service + "/request";
        String signString = "HMAC-SHA256" + "\n" + xDate + "\n" + credentialScope + "\n" + hashcanonicalString;

        byte[] signKey = genSigningSecretKeyV4(sk, shortXDate, service);
        return bytesToHex(hmacSHA256(signKey, signString));
    }

    public static String hashSHA256(byte[] content) throws Exception {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            return bytesToHex(md.digest(content));
        } catch (Exception e) {
            throw new Exception("Unable to compute hash while signing request: " + e.getMessage(), e);
        }
    }

    public static byte[] hmacSHA256(byte[] key, String content) throws Exception {
        try {
            Mac mac = Mac.getInstance("HmacSHA256");
            mac.init(new SecretKeySpec(key, "HmacSHA256"));
            return mac.doFinal(content.getBytes());
        } catch (Exception e) {
            throw new Exception("Unable to calculate a request signature: " + e.getMessage(), e);
        }
    }

    private static byte[] genSigningSecretKeyV4(String secretKey, String date, String service) throws Exception {
        byte[] kDate = hmacSHA256((secretKey).getBytes(), date);
        byte[] kService = hmacSHA256(kDate, service);
        return hmacSHA256(kService, "request");
    }

    public static String bytesToHex(byte[] bytes) {
        if (bytes == null || bytes.length == 0) {
            return "";
        }
        final StringBuilder result = new StringBuilder();
        for (byte b : bytes) {
            result.append(String.format("%02x", b));
        }
        return result.toString();
    }

}

API Call Demo Example (Java)

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.Feature;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Slf4j
@Component
public class ApiRequestUtils {
    private static final String API_HOST = "api.vmoscloud.com";
    private static final String CONTENT_TYPE = "application/json;charset=UTF-8";
    private static final String ACCESS_KEY = "Access Key ID";
    private static final String SECRET_ACCESS_KEY = "Secret Access Key";

    /**
     * Test Call
     */
    public static void main(String[] args) {
        //POST request
        JSONObject params = new JSONObject();
        params.put("taskIds", new int[]{4224});
        String url = "https://api.vmoscloud.com/vcpcloud/api/padApi/padTaskDetail";
        String result = sendPostRequest(url, params);
        System.out.println(result);

        //GET request
//        String url = "https://api.vmoscloud.com/vcpcloud/api/padApi/stsToken";
//        String result = sendGetRequest(url, null);
    }

    public static String sendGetRequest(String url, JSONObject params) {
        String xDate = DateToUTC(LocalDateTime.now());
        StringBuilder urlWithParams = new StringBuilder(url);

        // Constructing URL parameters
        if (params != null && !params.isEmpty()) {
            urlWithParams.append("?");
            params.forEach((key, value) ->
                    urlWithParams.append(key).append("=").append(value).append("&")
            );
            // Remove the final "&"
            urlWithParams.setLength(urlWithParams.length() - 1);
        }

        HttpGet httpGet = new HttpGet(urlWithParams.toString());

        // Set public header
        httpGet.setHeader("content-type", CONTENT_TYPE);
        httpGet.setHeader("x-host", API_HOST);
        httpGet.setHeader("x-date", xDate);

        // Generate Authorization Header
        String authorizationHeader = getAuthorizationHeader(xDate, params == null ? null : params.toJSONString(), SECRET_ACCESS_KEY);
        httpGet.setHeader("authorization", authorizationHeader);
        
        try (CloseableHttpClient httpClient = HttpClients.createDefault();
             CloseableHttpResponse response = httpClient.execute(httpGet)) {

            HttpEntity responseEntity = response.getEntity();
            return EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);

        } catch (Exception e) {
            throw new RuntimeException("Request failed", e);
        }
    }


    /**
     * Public request methods
     */
    public static String sendPostRequest(String url, JSONObject params) {
        String xDate = DateToUTC(LocalDateTime.now());
        HttpPost httpPost = new HttpPost(url);

        // Set public header
        httpPost.setHeader("content-type", CONTENT_TYPE);
        httpPost.setHeader("x-host", API_HOST);
        httpPost.setHeader("x-date", xDate);

        // Generate Authorization Header
        String authorizationHeader = getAuthorizationHeader(xDate, params.toJSONString(), SECRET_ACCESS_KEY);
        httpPost.setHeader("authorization", authorizationHeader);

        // Set the request body
        StringEntity entity = new StringEntity(params.toJSONString(), StandardCharsets.UTF_8);
        httpPost.setEntity(entity);

        // Execute Request
        try (CloseableHttpClient httpClient = HttpClients.createDefault();
             CloseableHttpResponse response = httpClient.execute(httpPost)) {

            HttpEntity responseEntity = response.getEntity();
            return EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);

        } catch (Exception e) {
            throw new RuntimeException("Request failed", e);
        }
    }


    /**
     * Use UTC time, accurate to seconds
     *
     * @param dateTime LocalDateTime
     * @return String
     */
    public static String DateToUTC(LocalDateTime dateTime) {
        // Define date and time format
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuuMMdd'T'HHmmss'Z'");
        return dateTime.format(formatter);
    }


    /**
     * Get Signature
     */
    private static String getSign(String xDate, String sk, String requestBody) throws Exception {
        String body = requestBody == null ? null : JSONObject.parseObject(requestBody, Feature.OrderedField).toJSONString();
        return PaasSignUtils.signature(CONTENT_TYPE, "content-type;host;x-content-sha256;x-date", API_HOST, xDate, sk, body == null ? null : body.getBytes(StandardCharsets.UTF_8));
    }

    /**
     * Get the Authorization header
     */
    private static String getAuthorizationHeader(String currentTimestamp, String body, String sk) {
        try {
            String sign = getSign(currentTimestamp, sk, body);
            return String.format("HMAC-SHA256 Credential=%s, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature=%s", ACCESS_KEY, sign);
        } catch (Exception e) {
            throw new RuntimeException("Failed to generate signature", e);
        }
    }

}

Interface call demo example (python)

import binascii
import datetime
import hmac
import hashlib
import json
import traceback

import requests


def get_signature(data, x_date, host, content_type, signed_headers, sk):
    # Given JSON data
    # TODO Convert JSON data to string (Modify the place, the incoming JSON needs to remove spaces)
    json_string = json.dumps(data, separators=(',', ':'), ensure_ascii = False)
    print(json_string)

    # Calculate the SHA-256 hash value
    hash_object = hashlib.sha256(json_string.encode())
    x_content_sha256 = hash_object.hexdigest()

    # Using f-string to build canonicalStringBuilder
    canonical_string_builder = (
        f"host:{host}\n"
        f"x-date:{x_date}\n"
        f"content-type:{content_type}\n"
        f"signedHeaders:{signed_headers}\n"
        f"x-content-sha256:{x_content_sha256}"
    )

    # Assume these variables have been assigned values
    # short_x_date = datetime.datetime.now().strftime("%Y%m%d") # Short request time, for example: "20240101"
    short_x_date = x_date[:8] # Short request time, for example: "20240101"
    service = "armcloud-paas" # Service name

    # Constructing credentialScope
    credential_scope = "{}/{}/request".format(short_x_date, service)

    # Assume these variables have been assigned
    algorithm = "HMAC-SHA256"

    # Calculate the SHA-256 hash of canonicalStringBuilder
    hash_sha256 = hashlib.sha256(canonical_string_builder.encode()).hexdigest()
    # Constructing StringToSign
    string_to_sign = (
            algorithm + '\n' +
            x_date + '\n' +
            credential_scope + '\n' +
            hash_sha256
    )

    # Assume these variables have been assigned values
    service = "armcloud-paas" # Service name

    # First hmacSHA256
    first_hmac = hmac.new(sk.encode(), digestmod=hashlib.sha256)
    first_hmac.update(short_x_date.encode())
    first_hmac_result = first_hmac.digest()

    # Second hmacSHA256
    second_hmac = hmac.new(first_hmac_result, digestmod=hashlib.sha256)
    second_hmac.update(service.encode())
    second_hmac_result = second_hmac.digest()

    # The third hmacSHA256
    signing_key = hmac.new(second_hmac_result, b'request', digestmod=hashlib.sha256).digest()

    # Calculate HMAC-SHA256 using signing_key and string_to_sign
    signature_bytes = hmac.new(signing_key, string_to_sign.encode(), hashlib.sha256).digest()

    # Convert the result of HMAC-SHA256 to a hexadecimal encoded string
    signature = binascii.hexlify(signature_bytes).decode()

    return signature


def paas_url_util(url, data, ak, sk):
    x_date = datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ")
    content_type = "application/json"
    signed_headers = f"content-type;host;x-content-sha256;x-date"
    ShortDate = x_date[:8]
    host = "openapi-hk.armcloud.net"
    # Get signature
    signature = get_signature(data, x_date, host, content_type, signed_headers, sk)
    url = f"http://openapi-hk.armcloud.net{url}"
    payload = json.dumps(data)
    headers = {
        'Content-Type': content_type,
        'x-date': x_date,
        'x-host': host,
        'authorization': f"HMAC-SHA256 Credential={ak}/{ShortDate}/armcloud-paas/request, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature={signature}"
    }
    response = requests.request("POST", url, headers=headers, data=payload)
    return response.json()


def vmos_url_util(url, data, AccessKey, sk):
    x_date = datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ")
    content_type = "application/json;charset=UTF-8"
    signed_headers = f"content-type;host;x-content-sha256;x-date"
    ShortDate = x_date[:8]
    host = "api.vmoscloud.com"

    # Get signature
    signature = get_signature(data, x_date, host, content_type, signed_headers, sk)
    url = f"https://api.vmoscloud.com{url}"

    payload = json.dumps(data, ensure_ascii = False)
    headers = {
        'content-type': "application/json;charset=UTF-8",
        'x-date': x_date,
        'x-host': "api.vmoscloud.com",
        'authorization': f"HMAC-SHA256 Credential={AccessKey}, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature={signature}"
    }
    response = requests.request("POST", url, headers=headers, data=payload)
    return response.json()


#Get instance list information by paging based on query conditions/vcpcloud/api/padApi/infos
pad_infos_url='/vcpcloud/api/padApi/padTaskDetail'
pad_infos_body={"taskIds":[4224]}

#vmos interface call
print(vmos_url_util(pad_infos_url, pad_infos_body, 'Access Key ID','Secret Access Key'))

Signature Generation Utility Class Example(node)

const CryptoJS = require("crypto-js");
const moment = require("moment");

/**
 * Class for generating HMAC-SHA256 signatures for API requests to Vmos cloud services.
 */
class VmosAPISigner {
  constructor(accessKeyId, secretAccessKey) {
    this.accessKeyId = accessKeyId;
    this.secretAccessKey = secretAccessKey;
    this.contentType = "application/json;charset=UTF-8";
    this.host = "api.vmoscloud.com";
    this.service = "armcloud-paas";
    this.algorithm = "HMAC-SHA256";
  }

  // Generate authentication headers for API requests
  signRequest(requestOptions) {
    const { method, path, queryParams = {}, body = null } = requestOptions;

    // Process request parameters
    let params = "";
    if (method === "POST" && body) {
      params = typeof body === "string" ? body : JSON.stringify(body);
    } else if (method === "GET" && Object.keys(queryParams).length > 0) {
      params = new URLSearchParams(queryParams).toString();
    }

    // Generate timestamp
    const xDate = moment().utc().format("YYYYMMDDTHHmmss[Z]");
    const shortXDate = xDate.substring(0, 8);
    const credentialScope = `${shortXDate}/${this.service}/request`;

    // Build canonical request string
    const canonicalString = [
      `host:${this.host}`,
      `x-date:${xDate}`,
      `content-type:${this.contentType}`,
      `signedHeaders:content-type;host;x-content-sha256;x-date`,
      `x-content-sha256:${CryptoJS.SHA256(params).toString()}`,
    ].join("\n");

    // Calculate signature
    const stringToSign = [
      this.algorithm,
      xDate,
      credentialScope,
      CryptoJS.SHA256(canonicalString).toString(),
    ].join("\n");

    const kDate = CryptoJS.HmacSHA256(shortXDate, this.secretAccessKey);
    const kService = CryptoJS.HmacSHA256(this.service, kDate);
    const signKey = CryptoJS.HmacSHA256("request", kService);

    // Generate final signature
    const sign = CryptoJS.HmacSHA256(stringToSign, signKey);
    const signature = sign.toString(CryptoJS.enc.Hex);

    // Construct authorization header
    const authorization = [
      `HMAC-SHA256 Credential=${this.accessKeyId}/${credentialScope}`,
      `SignedHeaders=content-type;host;x-content-sha256;x-date`,
      `Signature=${signature}`,
    ].join(", ");

    // Return signed request headers
    return {
      "x-date": xDate,
      "x-host": this.host,
      authorization: authorization,
      "content-type": this.contentType,
    };
  }
}

API Call Demo Example(node)

const CryptoJS = require("crypto-js");
const moment = require("moment");
const axios = require("axios");

axios.interceptors.request.use(
  (config) => {
    // Convert Content-Type header to lowercase
    if (config.headers["Content-Type"]) {
      config.headers["content-type"] = config.headers["Content-Type"];
      delete config.headers["Content-Type"];
    }
    return config;
  },
  (error) => {
    // Handle request errors
    return Promise.reject(error);
  }
);

/**
 * Class for generating HMAC-SHA256 signatures for API requests to Vmos cloud services.
 */
class VmosAPISigner {
  constructor(accessKeyId, secretAccessKey) {
    this.accessKeyId = accessKeyId;
    this.secretAccessKey = secretAccessKey;
    this.contentType = "application/json;charset=UTF-8";
    this.host = "api.vmoscloud.com";
    this.service = "armcloud-paas";
    this.algorithm = "HMAC-SHA256";
  }

  // Generate authentication headers for API requests
  signRequest(requestOptions) {
    const { method, path, queryParams = {}, body = null } = requestOptions;

    // Process request parameters
    let params = "";
    if (method === "POST" && body) {
      params = typeof body === "string" ? body : JSON.stringify(body);
    } else if (method === "GET" && Object.keys(queryParams).length > 0) {
      params = new URLSearchParams(queryParams).toString();
    }

    // Generate timestamp
    const xDate = moment().utc().format("YYYYMMDDTHHmmss[Z]");
    const shortXDate = xDate.substring(0, 8);
    const credentialScope = `${shortXDate}/${this.service}/request`;

    // Build canonical request string
    const canonicalString = [
      `host:${this.host}`,
      `x-date:${xDate}`,
      `content-type:${this.contentType}`,
      `signedHeaders:content-type;host;x-content-sha256;x-date`,
      `x-content-sha256:${CryptoJS.SHA256(params).toString()}`,
    ].join("\n");

    // Calculate signature
    const stringToSign = [
      this.algorithm,
      xDate,
      credentialScope,
      CryptoJS.SHA256(canonicalString).toString(),
    ].join("\n");

    const kDate = CryptoJS.HmacSHA256(shortXDate, this.secretAccessKey);
    const kService = CryptoJS.HmacSHA256(this.service, kDate);
    const signKey = CryptoJS.HmacSHA256("request", kService);

    // Generate final signature
    const sign = CryptoJS.HmacSHA256(stringToSign, signKey);
    const signature = sign.toString(CryptoJS.enc.Hex);

    // Construct authorization header
    const authorization = [
      `HMAC-SHA256 Credential=${this.accessKeyId}/${credentialScope}`,
      `SignedHeaders=content-type;host;x-content-sha256;x-date`,
      `Signature=${signature}`,
    ].join(", ");

    // Return signed request headers
    return {
      "x-date": xDate,
      "x-host": this.host,
      authorization: authorization,
      "content-type": this.contentType,
    };
  }
}

// 使用示例
async function makeSignedRequest() {
  const signer = new VmosAPISigner(
    "", // Access Key ID
    "" // Secret Access Key
  );

  const baseURL = "https://api.vmoscloud.com";

  // Example GET request configuration
  const getRequest = {
    method: "GET",
    path: "/vcpcloud/api/padApi/getProxys",
    queryParams: { page: 1, rows: 10 },
  };

  // Example POST request configuration
  const postRequest = {
    method: "POST",
    path: "/vcpcloud/api/padApi/userPadList",
    body: { padCode: "AC32010790572" },
  };

  await axios({
    baseURL: baseURL,
    method: getRequest.method,
    url: getRequest.path,
    headers: signer.signRequest(getRequest),
    params: getRequest.queryParams,
  }).then((response) => {
    console.log("getRequest 响应:", response.data);
  });

  await axios({
    baseURL: baseURL,
    method: postRequest.method,
    url: postRequest.path,
    headers: signer.signRequest(postRequest),
    data: postRequest.body,
  }).then((response) => {
    console.log("postRequest 响应:", response.data);
  });
}

// Run example requests
makeSignedRequest();

Signature Generation Utility Class Example(go)

package main

import (
	"bytes"
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"sort"
	"strings"
	"time"
)

type VmosAPISigner struct {
	AccessKeyId     string
	SecretAccessKey string
	ContentType     string
	Host            string
	Service         string
	Algorithm       string
}

func NewVmosAPISigner(accessKeyId, secretAccessKey string) *VmosAPISigner {
	return &VmosAPISigner{
		AccessKeyId:     accessKeyId,
		SecretAccessKey: secretAccessKey,
		ContentType:     "application/json;charset=UTF-8",
		Host:            "api.vmoscloud.com",
		Service:         "armcloud-paas",
		Algorithm:       "HMAC-SHA256",
	}
}

func sha256Hex(data string) string {
	hash := sha256.Sum256([]byte(data))
	return hex.EncodeToString(hash[:])
}

func hmacSHA256(key []byte, data string) []byte {
	h := hmac.New(sha256.New, key)
	h.Write([]byte(data))
	return h.Sum(nil)
}

func (s *VmosAPISigner) SignRequest(method, path string,
	queryParams map[string]string,
	body interface{}) map[string]string {
	var paramStr string
	if method == http.MethodPost && body != nil {
		bodyBytes, _ := json.Marshal(body)
		paramStr = string(bodyBytes)
	} else if method == http.MethodGet && len(queryParams) > 0 {
		var queryParts []string
		for k, v := range queryParams {
			queryParts = append(queryParts, url.QueryEscape(k)+"="+url.QueryEscape(v))
		}
		sort.Strings(queryParts)
		paramStr = strings.Join(queryParts, "&")
	}

	xDate := time.Now().UTC().Format("20060102T150405Z")
	shortDate := xDate[:8]
	credentialScope := fmt.Sprintf("%s/%s/request", shortDate, s.Service)

	// Canonical string
	canonicalString := fmt.Sprintf(
		"host:%s\nx-date:%s\ncontent-type:%s\nsignedHeaders:content-type;host;x-content-sha256;x-date\nx-content-sha256:%s",
		s.Host,
		xDate,
		s.ContentType,
		sha256Hex(paramStr),
	)

	// String to sign
	stringToSign := fmt.Sprintf(
		"%s\n%s\n%s\n%s",
		s.Algorithm,
		xDate,
		credentialScope,
		sha256Hex(canonicalString),
	)

	kDate := hmacSHA256([]byte(s.SecretAccessKey), shortDate)
	kService := hmacSHA256(kDate, s.Service)
	signKey := hmacSHA256(kService, "request")

	signature := hex.EncodeToString(hmacSHA256(signKey, stringToSign))

	authorization := fmt.Sprintf(
		"HMAC-SHA256 Credential=%s/%s, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature=%s",
		s.AccessKeyId,
		credentialScope,
		signature,
	)

	return map[string]string{
		"x-date":        xDate,
		"x-host":        s.Host,
		"authorization": authorization,
		"content-type":  s.ContentType,
	}
}

API Call Demo Example(go)

package main

import (
	"bytes"
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"sort"
	"strings"
	"time"
)

type VmosAPISigner struct {
	AccessKeyId     string
	SecretAccessKey string
	ContentType     string
	Host            string
	Service         string
	Algorithm       string
}

func NewVmosAPISigner(accessKeyId, secretAccessKey string) *VmosAPISigner {
	return &VmosAPISigner{
		AccessKeyId:     accessKeyId,
		SecretAccessKey: secretAccessKey,
		ContentType:     "application/json;charset=UTF-8",
		Host:            "api.vmoscloud.com",
		Service:         "armcloud-paas",
		Algorithm:       "HMAC-SHA256",
	}
}

func sha256Hex(data string) string {
	hash := sha256.Sum256([]byte(data))
	return hex.EncodeToString(hash[:])
}

func hmacSHA256(key []byte, data string) []byte {
	h := hmac.New(sha256.New, key)
	h.Write([]byte(data))
	return h.Sum(nil)
}

func (s *VmosAPISigner) SignRequest(method, path string,
	queryParams map[string]string,
	body interface{}) map[string]string {
	var paramStr string
	if method == http.MethodPost && body != nil {
		bodyBytes, _ := json.Marshal(body)
		paramStr = string(bodyBytes)
	} else if method == http.MethodGet && len(queryParams) > 0 {
		var queryParts []string
		for k, v := range queryParams {
			queryParts = append(queryParts, url.QueryEscape(k)+"="+url.QueryEscape(v))
		}
		sort.Strings(queryParts)
		paramStr = strings.Join(queryParts, "&")
	}

	xDate := time.Now().UTC().Format("20060102T150405Z")
	shortDate := xDate[:8]
	credentialScope := fmt.Sprintf("%s/%s/request", shortDate, s.Service)

	// Canonical string
	canonicalString := fmt.Sprintf(
		"host:%s\nx-date:%s\ncontent-type:%s\nsignedHeaders:content-type;host;x-content-sha256;x-date\nx-content-sha256:%s",
		s.Host,
		xDate,
		s.ContentType,
		sha256Hex(paramStr),
	)

	// String to sign
	stringToSign := fmt.Sprintf(
		"%s\n%s\n%s\n%s",
		s.Algorithm,
		xDate,
		credentialScope,
		sha256Hex(canonicalString),
	)

	kDate := hmacSHA256([]byte(s.SecretAccessKey), shortDate)
	kService := hmacSHA256(kDate, s.Service)
	signKey := hmacSHA256(kService, "request")

	signature := hex.EncodeToString(hmacSHA256(signKey, stringToSign))

	authorization := fmt.Sprintf(
		"HMAC-SHA256 Credential=%s/%s, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature=%s",
		s.AccessKeyId,
		credentialScope,
		signature,
	)

	return map[string]string{
		"x-date":        xDate,
		"x-host":        s.Host,
		"authorization": authorization,
		"content-type":  s.ContentType,
	}
}

func sendRequest(method, path string, queryParams map[string]string, body interface{}, signer *VmosAPISigner) {
	baseURL := "https://api.vmoscloud.com"

	// Build URL
	fullURL := baseURL + path
	if method == http.MethodGet && len(queryParams) > 0 {
		values := url.Values{}
		for k, v := range queryParams {
			values.Add(k, v)
		}
		fullURL += "?" + values.Encode()
	}

	// Prepare body
	var bodyReader io.Reader
	if method == http.MethodPost && body != nil {
		bodyBytes, _ := json.Marshal(body)
		bodyReader = bytes.NewReader(bodyBytes)
	}

	// Sign
	headers := signer.SignRequest(method, path, queryParams, body)

	// Create request
	req, err := http.NewRequest(method, fullURL, bodyReader)
	if err != nil {
		fmt.Println("Failed to create request:", err)
		return
	}

	for k, v := range headers {
		req.Header[k] = []string{v}
	}

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Request failed:", err)
		return
	}
	defer resp.Body.Close()

	respBody, _ := io.ReadAll(resp.Body)
	fmt.Printf("[%s] %s\n", method, string(respBody))
}

func main() {
	signer := NewVmosAPISigner(
		"", // Access Key ID
		"",         // Secret Access Key
	)

	// Example GET request
	getParams := map[string]string{
		"page": "1",
		"rows": "10",
	}
	sendRequest("GET", "/vcpcloud/api/padApi/getProxys", getParams, nil, signer)

	// Example POST request
	postBody := map[string]string{
		"padCode": "AC32010790572",
	}
	sendRequest("POST", "/vcpcloud/api/padApi/userPadList", nil, postBody, signer)
}

Signature Generation Utility Class Example(php)

<?php

class VmosAPISigner
{
  private $accessKeyId;
  private $secretAccessKey;
  private $contentType = "application/json;charset=UTF-8";
  private $host = "api.vmoscloud.com";
  private $service = "armcloud-paas";
  private $algorithm = "HMAC-SHA256";

  // Constructor for VmosAPISigner
  public function __construct($accessKeyId, $secretAccessKey)
  {
    $this->accessKeyId = $accessKeyId;
    $this->secretAccessKey = $secretAccessKey;
  }

  // Generate authentication headers for API requests
  public function signRequest($method, $path, $queryParams = [], $body = null)
  {
    $params = "";
    if (strtoupper($method) === "POST" && $body !== null) {
      $params = is_string($body) ? $body : json_encode($body, JSON_UNESCAPED_UNICODE);
    } elseif (strtoupper($method) === "GET" && !empty($queryParams)) {
      $params = http_build_query($queryParams);
    }

    $xDate = gmdate("Ymd\THis\Z");
    $shortXDate = substr($xDate, 0, 8);
    $credentialScope = "$shortXDate/{$this->service}/request";

    $xContentSha256 = hash("sha256", $params);

    $canonicalString = implode("\n", [
      "host:{$this->host}",
      "x-date:$xDate",
      "content-type:{$this->contentType}",
      "signedHeaders:content-type;host;x-content-sha256;x-date",
      "x-content-sha256:$xContentSha256"
    ]);

    $hashedCanonicalString = hash("sha256", $canonicalString);

    $stringToSign = implode("\n", [
      $this->algorithm,
      $xDate,
      $credentialScope,
      $hashedCanonicalString
    ]);

    $kDate = hash_hmac("sha256", $shortXDate, $this->secretAccessKey, true);
    $kService = hash_hmac("sha256", $this->service, $kDate, true);
    $signKey = hash_hmac("sha256", "request", $kService, true);

    $signature = hash_hmac("sha256", $stringToSign, $signKey);

    $authorization = implode(", ", [
      "{$this->algorithm} Credential={$this->accessKeyId}/$credentialScope",
      "SignedHeaders=content-type;host;x-content-sha256;x-date",
      "Signature=$signature"
    ]);

    return [
      "x-date: $xDate",
      "x-host: {$this->host}",
      "authorization: $authorization",
      "content-type: {$this->contentType}"
    ];
  }
}

API Call Demo Example(php)

<?php

class VmosAPISigner
{
  private $accessKeyId;
  private $secretAccessKey;
  private $contentType = "application/json;charset=UTF-8";
  private $host = "api.vmoscloud.com";
  private $service = "armcloud-paas";
  private $algorithm = "HMAC-SHA256";

  // Constructor for VmosAPISigner
  public function __construct($accessKeyId, $secretAccessKey)
  {
    $this->accessKeyId = $accessKeyId;
    $this->secretAccessKey = $secretAccessKey;
  }

  // Generate authentication headers for API requests
  public function signRequest($method, $path, $queryParams = [], $body = null)
  {
    $params = "";
    if (strtoupper($method) === "POST" && $body !== null) {
      $params = is_string($body) ? $body : json_encode($body, JSON_UNESCAPED_UNICODE);
    } elseif (strtoupper($method) === "GET" && !empty($queryParams)) {
      $params = http_build_query($queryParams);
    }

    $xDate = gmdate("Ymd\THis\Z");
    $shortXDate = substr($xDate, 0, 8);
    $credentialScope = "$shortXDate/{$this->service}/request";

    $xContentSha256 = hash("sha256", $params);

    $canonicalString = implode("\n", [
      "host:{$this->host}",
      "x-date:$xDate",
      "content-type:{$this->contentType}",
      "signedHeaders:content-type;host;x-content-sha256;x-date",
      "x-content-sha256:$xContentSha256"
    ]);

    $hashedCanonicalString = hash("sha256", $canonicalString);

    $stringToSign = implode("\n", [
      $this->algorithm,
      $xDate,
      $credentialScope,
      $hashedCanonicalString
    ]);

    $kDate = hash_hmac("sha256", $shortXDate, $this->secretAccessKey, true);
    $kService = hash_hmac("sha256", $this->service, $kDate, true);
    $signKey = hash_hmac("sha256", "request", $kService, true);

    $signature = hash_hmac("sha256", $stringToSign, $signKey);

    $authorization = implode(", ", [
      "{$this->algorithm} Credential={$this->accessKeyId}/$credentialScope",
      "SignedHeaders=content-type;host;x-content-sha256;x-date",
      "Signature=$signature"
    ]);

    return [
      "x-date: $xDate",
      "x-host: {$this->host}",
      "authorization: $authorization",
      "content-type: {$this->contentType}"
    ];
  }
}

function makeSignedRequest()
{
  $signer = new VmosAPISigner(
    "",  // Access Key ID
    ""  // Secret Access Key
  );

  $baseURL = "https://api.vmoscloud.com";

  // Example GET request
  $getPath = "/vcpcloud/api/padApi/getProxys";
  $getParams = ["page" => 1, "rows" => 10];
  $getHeaders = $signer->signRequest("GET", $getPath, $getParams);

  $getUrl = $baseURL . $getPath . '?' . http_build_query($getParams);
  $getCurl = curl_init($getUrl);
  curl_setopt($getCurl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($getCurl, CURLOPT_HTTPHEADER, $getHeaders);
  curl_setopt($getCurl, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($getCurl, CURLOPT_SSL_VERIFYHOST, false);

  $getResponse = curl_exec($getCurl);
  curl_close($getCurl);
  echo "GET Response:\n" . $getResponse . "\n";

  // Example POST request
  $postPath = "/vcpcloud/api/padApi/userPadList";
  $postData = ["padCode" => "AC32010790572"];
  $postHeaders = $signer->signRequest("POST", $postPath, [], $postData);

  $postCurl = curl_init($baseURL . $postPath);
  curl_setopt($postCurl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($postCurl, CURLOPT_POST, true);
  curl_setopt($postCurl, CURLOPT_HTTPHEADER, $postHeaders);
  curl_setopt($postCurl, CURLOPT_POSTFIELDS, json_encode($postData, JSON_UNESCAPED_UNICODE));
  curl_setopt($postCurl, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($postCurl, CURLOPT_SSL_VERIFYHOST, false);

  $postResponse = curl_exec($postCurl);
  if (curl_errno($postCurl)) {
    echo "cURL Error: \n" . curl_error($postCurl) . "\n";
  } else {
    $httpCode = curl_getinfo($postCurl, CURLINFO_HTTP_CODE);
    echo "POST Response HTTP Status: $httpCode\n";
    echo "POST Response:\n$postResponse\n";
  }
  curl_close($postCurl);
}

// Execute the signature request
makeSignedRequest();

Signature Generation Utility Class Example(.net)

using System;
using System.Net.Http;
using System.Text;
using System.Security.Cryptography;
using System.Text.Json;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using System.Security.Cryptography;

public class VmosAPISigner
{
    private readonly string accessKeyId;
    private readonly string secretAccessKey;
    private readonly string contentType = "application/json;charset=utf-8";
    private readonly string host = "api.vmoscloud.com";
    private readonly string service = "armcloud-paas";
    private readonly string algorithm = "HMAC-SHA256";

    public VmosAPISigner(string accessKeyId, string secretAccessKey)
    {
        this.accessKeyId = accessKeyId;
        this.secretAccessKey = secretAccessKey;
    }

    public Dictionary<string, string> SignRequest(string method, string path, Dictionary<string, string>? queryParams = null, object? body = null)
    {
        string paramsString = "";

        if (method == "POST" && body != null)
        {
            paramsString = JsonSerializer.Serialize(body);
        }
        else if (method == "GET" && queryParams != null)
        {
            var query = new FormUrlEncodedContent(queryParams).ReadAsStringAsync().Result;
            paramsString = query;
        }

        var utcNow = DateTime.UtcNow;
        var xDate = utcNow.ToString("yyyyMMdd'T'HHmmss'Z'");
        var shortXDate = utcNow.ToString("yyyyMMdd");
        var credentialScope = $"{shortXDate}/{service}/request";

        // Hash body or params
        var payloadHash = SHA256Hex(paramsString);

        // Canonical string
        var canonicalString = string.Join("\n", new[]
                                      {
                                          $"host:{host}",
                                          $"x-date:{xDate}",
                                          $"content-type:{contentType}",
                                          $"signedHeaders:content-type;host;x-content-sha256;x-date",
                                          $"x-content-sha256:{payloadHash}"
                                          });

        // Create string to sign
        var stringToSign = string.Join("\n", new[]
                                   {
                                       algorithm,
                                       xDate,
                                       credentialScope,
                                       SHA256Hex(canonicalString)
                                       });


        // Derive signing key
        var kDate = HmacSHA256(shortXDate, secretAccessKey);

        var kService = HmacSHA256(service, kDate);

        var signKey = HmacSHA256("request", kService);

        var signature = ByteArrayToHex(HmacSHA256(stringToSign, signKey));

        var authorization = string.Join(", ", new[]
                                    {
                                        $"{algorithm} Credential={accessKeyId}/{credentialScope}",
                                        "SignedHeaders=content-type;host;x-content-sha256;x-date",
                                        $"Signature={signature}"
                                        });

        return new Dictionary<string, string>
        {
            { "x-date", xDate },
            { "x-host", host },
            { "authorization", authorization },
            { "content-type", contentType }
        };
    }

    private static string SHA256Hex(string data)
    {
        using var sha256 = SHA256.Create();
        byte[] hashBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(data));
        return BitConverter.ToString(hashBytes).Replace("-", "").ToLowerInvariant();
    }

    private static byte[] HmacSHA256(string data, string key)
    {
        return HmacSHA256(data, Encoding.UTF8.GetBytes(key));
    }

  private static byte[] HmacSHA256(string data, byte[] key)
  {
    using var hmac = new HMACSHA256(key);
    return hmac.ComputeHash(Encoding.UTF8.GetBytes(data));
  }

  private static string ByteArrayToHex(byte[] bytes)
  {
    return BitConverter.ToString(bytes).Replace("-", "").ToLowerInvariant();
  }
}

API Call Demo Example(.net)

Signer.cs

using System;
using System.Net.Http;
using System.Text;
using System.Security.Cryptography;
using System.Text.Json;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using System.Security.Cryptography;

public class VmosAPISigner
{
    private readonly string accessKeyId;
    private readonly string secretAccessKey;
    private readonly string contentType = "application/json;charset=utf-8";
    private readonly string host = "api.vmoscloud.com";
    private readonly string service = "armcloud-paas";
    private readonly string algorithm = "HMAC-SHA256";

    public VmosAPISigner(string accessKeyId, string secretAccessKey)
    {
        this.accessKeyId = accessKeyId;
        this.secretAccessKey = secretAccessKey;
    }

    public Dictionary<string, string> SignRequest(string method, string path, Dictionary<string, string>? queryParams = null, object? body = null)
    {
        string paramsString = "";

        if (method == "POST" && body != null)
        {
            paramsString = JsonSerializer.Serialize(body);
        }
        else if (method == "GET" && queryParams != null)
        {
            var query = new FormUrlEncodedContent(queryParams).ReadAsStringAsync().Result;
            paramsString = query;
        }

        var utcNow = DateTime.UtcNow;
        var xDate = utcNow.ToString("yyyyMMdd'T'HHmmss'Z'");
        var shortXDate = utcNow.ToString("yyyyMMdd");
        var credentialScope = $"{shortXDate}/{service}/request";

        // Hash body or params
        var payloadHash = SHA256Hex(paramsString);

        // Canonical string
        var canonicalString = string.Join("\n", new[]
                                      {
                                          $"host:{host}",
                                          $"x-date:{xDate}",
                                          $"content-type:{contentType}",
                                          $"signedHeaders:content-type;host;x-content-sha256;x-date",
                                          $"x-content-sha256:{payloadHash}"
                                          });

        // Create string to sign
        var stringToSign = string.Join("\n", new[]
                                   {
                                       algorithm,
                                       xDate,
                                       credentialScope,
                                       SHA256Hex(canonicalString)
                                       });


        // Derive signing key
        var kDate = HmacSHA256(shortXDate, secretAccessKey);

        var kService = HmacSHA256(service, kDate);

        var signKey = HmacSHA256("request", kService);

        var signature = ByteArrayToHex(HmacSHA256(stringToSign, signKey));

        var authorization = string.Join(", ", new[]
                                    {
                                        $"{algorithm} Credential={accessKeyId}/{credentialScope}",
                                        "SignedHeaders=content-type;host;x-content-sha256;x-date",
                                        $"Signature={signature}"
                                        });

        return new Dictionary<string, string>
        {
            { "x-date", xDate },
            { "x-host", host },
            { "authorization", authorization },
            { "content-type", contentType }
        };
    }

    private static string SHA256Hex(string data)
    {
        using var sha256 = SHA256.Create();
        byte[] hashBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(data));
        return BitConverter.ToString(hashBytes).Replace("-", "").ToLowerInvariant();
    }

    private static byte[] HmacSHA256(string data, string key)
    {
        return HmacSHA256(data, Encoding.UTF8.GetBytes(key));
    }

  private static byte[] HmacSHA256(string data, byte[] key)
  {
    using var hmac = new HMACSHA256(key);
    return hmac.ComputeHash(Encoding.UTF8.GetBytes(data));
  }

  private static string ByteArrayToHex(byte[] bytes)
  {
    return BitConverter.ToString(bytes).Replace("-", "").ToLowerInvariant();
  }
}

Request.cs

using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;
using System.Net.Http.Headers;

class Program
{
  static async Task Main()
  {
    var signer = new VmosAPISigner(
        "", // Access Key ID
        "" // Secret Access Key
    );

    using var client = new HttpClient { BaseAddress = new Uri("https://api.vmoscloud.com") };

    // Example GET request
    var getPath = "/vcpcloud/api/padApi/getProxys";
    var getParams = new Dictionary<string, string>
    {
        { "page", "1" },
        { "rows", "10" }
    };
    var getHeaders = signer.SignRequest("GET", getPath, getParams);
    var getQuery = new FormUrlEncodedContent(getParams).ReadAsStringAsync().Result;
    var getRequest = new HttpRequestMessage(HttpMethod.Get, $"{getPath}?{getQuery}");
    foreach (var h in getHeaders)
    {
      getRequest.Headers.TryAddWithoutValidation(h.Key, h.Value);
    }
    var getHttpContent = new StringContent("", Encoding.UTF8, "application/json");
    getRequest.Content = getHttpContent;
    var getResponse = await client.SendAsync(getRequest);
    Console.WriteLine("GET Response: " + await getResponse.Content.ReadAsStringAsync() + "\n");

    // Example POST request
    var postPath = "/vcpcloud/api/padApi/userPadList";
    var postBody = new { padCode = "AC32010790572" };
    var postHeaders = signer.SignRequest("POST", postPath, null, postBody);
    var postRequest = new HttpRequestMessage(HttpMethod.Post, postPath);
    foreach (var h in postHeaders) postRequest.Headers.TryAddWithoutValidation(h.Key, h.Value);
    postRequest.Content = new StringContent(JsonSerializer.Serialize(postBody), Encoding.UTF8, "application/json");
    var postResponse = await client.SendAsync(postRequest);
    Console.WriteLine("POST Response: " + await postResponse.Content.ReadAsStringAsync() + "\n");
  }
}

Data encryption and decryption example

Java AES GCM Decryption

import javax.crypto.Cipher;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Base64;

public class AESUtils {
    private static final String AES = "AES";
    private static final String AES_CIPHER_ALGORITHM = "AES/GCM/NoPadding";
    private static final int GCM_TAG_LENGTH = 16;
    private static final int GCM_IV_LENGTH = 12;

    /**
     * Generates a SecretKeySpec from a given string key
     */
    private static SecretKeySpec getKeyFromPassword(String password) throws NoSuchAlgorithmException {
        MessageDigest sha = MessageDigest.getInstance("SHA-256");
        byte[] key = sha.digest(password.getBytes());
        return new SecretKeySpec(key, AES);
    }

    /**
     * Generates a new Initialization Vector (IV)
     */
    public static byte[] generateIv() {
        byte[] iv = new byte[GCM_IV_LENGTH];
        new SecureRandom().nextBytes(iv);
        return iv;
    }

    /**
     * Encrypts a plain text using AES algorithm and returns both the cipher text and IV
     */
    public static String encrypt(String input, String key) {
        try {
            SecretKeySpec secretKeySpec = getKeyFromPassword(key);
            byte[] iv = generateIv();
            Cipher cipher = Cipher.getInstance(AES_CIPHER_ALGORITHM);
            GCMParameterSpec gcmParameterSpec = new GCMParameterSpec(GCM_TAG_LENGTH * 8, iv);
            cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, gcmParameterSpec);
            byte[] cipherText = cipher.doFinal(input.getBytes());

            // Encode IV and cipher text to Base64 and concatenate them with a separator
            String ivString = Base64.getEncoder().encodeToString(iv);
            String cipherTextString = Base64.getEncoder().encodeToString(cipherText);
            return ivString + ":" + cipherTextString;
        } catch (Exception e) {
            log.error("encrypt error >>>input:{} key:{}", input, key, e);
            return null;
        }

    }

    /**
     * Decrypts an encrypted text using AES algorithm
     */
    public static String decrypt(String encryptedData, String key) {
        try {
            SecretKeySpec secretKeySpec = getKeyFromPassword(key);

            // Split the encrypted data into IV and cipher text
            String[] parts = encryptedData.split(":");
            String ivString = parts[0];
            String cipherTextString = parts[1];

            byte[] iv = Base64.getDecoder().decode(ivString);
            byte[] cipherText = Base64.getDecoder().decode(cipherTextString);

            Cipher cipher = Cipher.getInstance(AES_CIPHER_ALGORITHM);
            GCMParameterSpec gcmParameterSpec = new GCMParameterSpec(GCM_TAG_LENGTH * 8, iv);
            cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, gcmParameterSpec);
            byte[] plainText = cipher.doFinal(cipherText);
            return new String(plainText);
        } catch (Exception e) {
            log.error("decrypt error >>>encryptedData:{} key:{}", encryptedData, key, e);
            return null;
        }

    }

    /**
     * Encodes the input byte array to a Base64 string
     */
    public static String encodeToString(byte[] input) {
        return Base64.getEncoder().encodeToString(input);
    }

    // Encodes the input string to a Base64 string
    public static String encodeToString(String input) {
        return Base64.getEncoder().encodeToString(input.getBytes());
    }

    /**
     * Decodes the input Base64 string to a byte array
     */
    public static byte[] decodeToBytes(String input) {
        return Base64.getDecoder().decode(input);
    }

    /**
     * Decodes the input Base64 string to a regular string
     */
    public static String decodeToString(String input) {
        byte[] decodedBytes = Base64.getDecoder().decode(input);
        return new String(decodedBytes);
    }

    /**
     * Encodes the input byte array to a Base64 byte array
     */
    public static byte[] encodeToBytes(byte[] input) {
        return Base64.getEncoder().encode(input);
    }

    /**
     * Decodes the input Base64 byte array to a byte array
     */
    public static byte[] decodeToBytes(byte[] input) {
        return Base64.getDecoder().decode(input);
    }

    public static void main(String[] args) throws Exception {
        String key = "AC22030010001"; // 任意字符串作为密钥
        // Decrypt the cipher text
        String decryptedText = decrypt("iMzQUI7SwzSD0kGJ:4FZ1fn1Jdd5Z4j2ehn/F3VSUVWBwLFQZH/HOCjLAI95r", key);
        System.out.println("Decrypted text: " + decryptedText);
    }
}

API Overview

Instance Management

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/restartInstance RestartRestart a specified instance to resolve issues like system unresponsiveness or freezes.
/vcpcloud/api/padApi/resetInstance ResetReset a specified instance.
/vcpcloud/api/padApi/padPropertiesQuery Instance PropertiesQuery the properties of a specified instance.
/vcpcloud/api/padApi/batchPadPropertiesBatch Query Instance PropertiesBatch query the properties of specified instances, including system properties and configuration settings.
/vcpcloud/api/padApi/updatePadPropertiesModify Instance PropertiesDynamically modify the properties of an instance, including system properties and settings.
/vcpcloud/api/padApi/dissolveRoomStop StreamStop streaming on a specified instance.
/vcpcloud/api/padApi/updatePadAndroidPropModify Instance Android Device PropertiesModify the Android modification properties of an instance.
/vcpcloud/api/padApi/setProxySet Proxy for InstanceSet proxy information for a specified instance.
/vcpcloud/api/padApi/replacePadOne-Click New DeviceReplace the instance with a new machine in one click.
/vcpcloud/api/padApi/templateListGet real machine templates by pageGet real machine templates by page
/vcpcloud/api/padApi/countryQuery the list of countries supported by one-click new machinesQuery the list of countries supported by one-click new machines
/vcpcloud/api/padApi/replacementSwitch DeviceSwitch Device.
/vcpcloud/api/padApi/setWifiList修改实例wifi属性修改实例wifi属性

Instance Operations

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/asyncCmdExecute Async ADB CommandExecute adb commands in one or more cloud phone instances (asynchronous task).
/vcpcloud/api/padApi/syncCmdSynchronously Execute ADB CommandsExecute adb commands in one or more cloud phone instances (synchronous task).
/vcpcloud/api/padApi/generatePreviewGenerate Preview ImageTake a screenshot of the current cloud phone screen and get the download link for the screenshot.
/vcpcloud/api/padApi/openOnlineAdbEnable or disable ADBOpen or close instance adb according to instance number
/vcpcloud/api/padApi/adbGet ADB connection informationGet adb connection information based on the instance number. If the response data (key, adb) is incomplete, call Enable/Disable ADB to enable adb.
/vcpcloud/api/padApi/updateContactsModify ContactsModify the contacts list.
/vcpcloud/api/padApi/updateTimeZoneModify Instance Time ZoneModify the time zone of the instance.
/vcpcloud/api/padApi/updateLanguageModify Instance LanguageModify the language of the instance.
/vcpcloud/api/padApi/updateSIMModify Instance SIM Card InfoModify the SIM card information of the instance.
/vcpcloud/api/padApi/gpsInjectInfoSet Instance Latitude/LongitudeSet the latitude and longitude of the instance.
/vcpcloud/api/padApi/screenshotLocal ScreenshotTake a local screenshot.
/vcpcloud/api/padApi/upgradeImageUpgrade ImageUpgrade the image of the instance.
/vcpcloud/api/padApi/virtualRealSwitchUpgrade Physical Machine ImageUpgrade the physical machine image of the instance.
/vcpcloud/api/padApi/checkIPSmart IP Proxy CheckCheck the smart IP proxy.
/vcpcloud/api/padApi/smartIpSet Smart IPSet the smart IP.
/vcpcloud/api/padApi/notSmartIpCancel Intelligent IPCancel the intelligent IP setting.
/vcpcloud/api/padApi/getTaskStatusEquipment task execution result query.Equipment task execution result query.
/vcpcloud/api/padApi/switchRootModify instance wifi attributesModify instance wifi attributes

Resource Management

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/infosInstance List InformationQuery information about all ordered instances.

Application Management

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/installAppApplication InstallationInstall and deploy a specified application to the specified cloud instance (asynchronous task).
/vcpcloud/api/padApi/startAppStart AppStart App
/vcpcloud/api/padApi/stopAppStop AppStop App
/vcpcloud/api/padApi/restartAppRestart AppRestart App
/vcpcloud/api/padApi/listInstalledAppInstance installed application list queryQuery the list of installed applications for an instance
/vcpcloud/api/padApi/updateSIMModify sim card information according to country codeModify sim card information according to country code
/vcpcloud/api/padApi/uploadFileV3File upload interface directly through linkFile upload interface directly through link
/vcpcloud/api/padApi/setKeepAliveAppSet keepalive application interfaceSet keepalive application interface
/vcpcloud/api/padApi/addUserRomUpload user imageUpload user image

Task Management

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/padTaskDetailInstance Operation Task DetailsQuery detailed execution results of a specified instance operation task.
/vcpcloud/api/padApi/fileTaskDetailFile Task DetailsQuery detailed execution results of a specified file task.

Cloud Phone Management

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/createMoneyOrderCreate Cloud PhoneCreate a new cloud phone instance.
/vcpcloud/api/padApi/userPadListCloud Phone ListList of cloud phones.
/vcpcloud/api/padApi/padInfoCloud Phone Information QueryQuery the information of a cloud phone instance.
/vcpcloud/api/padApi/getCloudGoodListSKU Package ListList of SKU packages.
/vcpcloud/api/padApi/replaceRealAdiTemplateModify Real Machine ADI TemplateModify the ADI template of a physical machine.
/vcpcloud/api/padApi/createMoneyProOrderEquipment Pre-sale PurchaseEquipment Pre-sale Purchase
/vcpcloud/api/padApi/queryProOrderListQuery pre-sale order result detailsQuery pre-sale order result details
/vcpcloud/api/padApi/imageVersionListAndroid image version collectionAndroid image version collection
/vcpcloud/api/padApi/simulateTouchCloud machine simulated touchCloud machine simulated touch

TK Automation

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/autoTaskListAutomated Task List QueryQuery the list of automated tasks.
/vcpcloud/api/padApi/addAutoTaskCreate Automation TaskCreate a new automated task.
/vcpcloud/api/padApi/reExecutionAutoTaskAutomated Task RetryRetry an automated task.
/vcpcloud/api/padApi/cancelAutoTaskAutomated Task CancellationlationCancel an automated task.

SDK Token

API EndpointAPI NameAPI Description
/vcpcloud/api/padApi/stsTokenGet SDK Temporary TokenIssue a temporary SDK token for user authentication of cloud phone services.
/vcpcloud/api/padApi/stsTokenByPadCodeGet SDK Temporary TokenIssue a temporary SDK token for user authentication of cloud phone services, based on pad code.
/vcpcloud/api/padApi/clearStsTokenClear SDK Authorization TokenClear the SDK authorization token.

OpenAPI Interface List

Instance Management

Modify instance wifi attributes

Modify the wifi list properties of the specified instance (either this interface or setting up wifi on a new machine, otherwise there will be coverage issues).

Interface address

/vcpcloud/api/padApi/setWifiList

Request method

POST

Request data type

application/json

Request Body parameters

Parameter nameExample valueParameter typeRequired or notParameter description
padCodesString[]Yes
├─AC21020010001StringYesInstance number
wifiJsonListString[]Yeswifi attribute list
├─ ssid110101StringYeswifi name
├─ BSSID02:31:00:00:00:01StringYesAccess point mac address
├─ MAC02:00:10:00:00:00StringYeswifi network card mac address
├─ IP02:00:10:00:00:00StringYeswifi network IP
├─ MAC02:00:10:00:00:00StringYeswifi network + mac address
├─ gateway192.168.1.20StringYeswifi gateway
├─ DNS11.1.1.1StringYesDNS1
├─ DNS28.8.8.8StringYesDNS2
├─ hessid0IntegerNonetwork identifier
├─ anqpDomainId0IntegerNoANQP (Access Network Query Protocol) domain ID
├─ capabilities""StringNoWPA/WPA2 and other information
├─ level0IntegerNoSignal strength (RSSI)
├─ linkSpeed ​​500IntegerNoCurrent Wi-Fi connection speed
├─ txLinkSpeed ​​600IntegerNoUpload link speed
├─ rxLinkSpeed ​​700IntegerNoDownload link speed
├─ frequency2134IntegerNoWi-Fi channel frequency
├─ distance-1IntegerNoEstimated AP distance
├─ distanceSd-1IntegerNoStandard deviation of estimated distance
├─ channelWidth0IntegerNoChannel width
├─ centerfreq00IntegerNoCenter frequency 0
├─ centerfreq1-1IntegerNoCenter frequency 1
├─ is80211McRTTResponderfalseBooleanNoWhether to support 802.11mc (Wi-Fi RTT, ranging technology)

Response parameters

Parameter nameExample valueParameter typeParameter description
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]
├─taskId1IntegerTask ID
├─padCodeAC21020010001StringInstance number
├─vmStatus1IntegerInstance online status (0: offline; 1: online)

Request example

{
    "padCodes":["AC2025030770R92X"],
        "wifiJsonList":[{
        "ssid": "110101",
        "bssid": "02:31:00:00:00:01",
        "mac": "02:00:10:00:00:00",
        "ip": "192.168.120.15",
        "gateway": "192.168.120.1",
        "dns1": "1.1.1.1",
        "dns2": "8.8.8.8",
        "hessid": 0,
        "anqpDomainId": 0,
        "capabilities": "",
        "level": 0,
        "linkSpeed": 500,
        "txLinkSpeed": 600,
        "rxLinkSpeed": 700,
        "frequency": 2413,
        "distance": -1,
        "distanceSd": -1,
        "channelWidth": 0,
        "centerFreq0": -1,
        "centerFreq1": -1,
        "is80211McRTTResponder": true
    }]
}

Response Example

{
    "code": 200,
    "msg": "success",
    "ts":1713773577581,
    "data":[{
        "taskId": 1,
        "padCode": "AC21020010001",
        "vmStatus": 1
    }]
}

Instance Restart

Perform a restart on the specified instance to resolve system unresponsiveness, lag, and other issues. A new feature has been added to support changing the device's network IP after the restart.

API Endpoint

/vcpcloud/api/padApi/restart

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueTypeRequiredDescription
padCodesString[]Yes
├─AC21020010001StringYesInstance ID
groupIdsInteger[]No
├─1IntegerNoInstance Group ID
changeIpFlagfalseBooleanNoIs it necessary to change the network IP? True - Yes, False - No. Default - False.

Response Parameters

Parameter NameExample ValueTypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]
├─ taskId1IntegerTask ID
├─ padCodeAC21020010001StringInstance ID
├─ vmStatus1IntegerInstance online status (0: Offline; 1: Online)

Request Example

{
    "padCodes": [
        "AC22030022693"
    ],
    "changeIpFlag": false,
    "groupIds": [1]
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts":1713773577581,
	"data":[
        {
        "taskId": 1,
        "padCode": "AC21020010001",
        "vmStatus": 1
        }
    ]
}

Error Codes

Error CodeError DescriptionSuggested Action
10001Restart failedContact administrator
110004Failed to execute restart commandRetry restart later
110028Instance does not existCheck if the instance exists

Instance Reset

Performs a reset operation on the specified instance to clear applications and files.

API Endpoint

/vcpcloud/api/padApi/reset

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesString[]Yes
├─AC21020010001StringYesInstance ID
groupIdsInteger[]No
├─1IntegerNoInstance Group ID

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
ts1756021167163LongTimestamp
dataObject[]
├─ taskId1IntegerTask ID
├─ padCodeAC21020010001StringInstance ID
├─ vmStatus1IntegerInstance Online Status (0: Offline; 1: Online)

Request Example

{
	"padCodes": ["AC21020010001"],
	"groupIds": [1]
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717559681604,
	"data": [
		{
			"taskId": 88,
			"padCode": "AC22030010001",
			"vmStatus": 1
		},
		{
			"taskId": 89,
			"padCode": "AC22030010002",
			"vmStatus": 0
		}
	]
}

Error Codes

Error CodeError DescriptionSuggested Action
10002Reset failedContact administrator
110005Failed to execute reset commandRetry reset later

Query Instance Properties

Query the properties of a specified instance, including system property information and settings.

API Endpoint

/vcpcloud/api/padApi/padProperties

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueTypeRequiredDescription
padCodeAC21020010001StringYesInstance code

Response Parameters

Parameter NameExample ValueTypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject
├─ padCodeAC21020010001StringInstance code
├─ modemPropertiesListObject[]Modem properties list
├─ ├─ propertiesNameIMEIStringProperty name
├─ ├─ propertiesValue412327621057784StringProperty value
├─ systemPropertiesListObject[]System properties list
├─ ├─ propertiesNamero.build.idStringProperty name
├─ ├─ propertiesValueQQ3A.200805.001StringProperty value
├─ settingPropertiesListObject[]Setting properties list
├─ ├─ propertiesNamero.build.tagsStringProperty name
├─ ├─ propertiesValuerelease-keysStringProperty value
├─ oaidPropertiesListObject[]Oaid properties list
├─ ├─ propertiesNameoaidStringProperty name
├─ ├─ propertiesValue001StringProperty value

Request Example

{
	"padCode": "AC21020010001"
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts":1713773577581,
	"data": {
		"padCode": "AC21020010001",
		"modemPropertiesList": [
			{
				"propertiesName": "IMEI",
				"propertiesValue": "412327621057784"
			}
		],
		"systemPropertiesList": [
			{
				"propertiesName": "ro.build.id",
				"propertiesValue": "QQ3A.200805.001"
			}
		],
		"settingPropertiesList": [
			{
				"propertiesName": "ro.build.tags",
				"propertiesValue": "release-keys"
			}
		],
		"oaidPropertiesList": [
			{
				"propertiesName": "oaid",
				"propertiesValue": "001"
			}
		]
	}
}

Error Codes

Error CodeError DescriptionSuggested Action
110028Instance not foundPlease check if the instance is correct

Batch Query Instance Properties

Batch query the property information of specified instances, including system properties and settings.

API Endpoint

/vcpcloud/api/padApi/batchPadProperties

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodes["AC21020010001"]String[]Yes
├─AC21020010001StringYesInstance Code

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
ts1756021167163LongTimestamp
dataObject[]
├─ padCodeAC21020010001StringInstance Code
├─ modemPropertiesListObject[]Modem Properties List
├─ ├─ propertiesNameIMEIStringProperty Name
├─ ├─ propertiesValue412327621057784StringProperty Value
├─ systemPropertiesListObject[]System Properties List
├─ ├─ propertiesNamero.build.idStringProperty Name
├─ ├─ propertiesValueQQ3A.200805.001StringProperty Value
├─ settingPropertiesListObject[]Setting Properties List
├─ ├─ propertiesNamero.build.tagsStringProperty Name
├─ ├─ propertiesValuerelease-keysStringProperty Value
├─ oaidPropertiesListObject[]Oaid Properties List
├─ ├─ propertiesNameoaidStringProperty Name
├─ ├─ propertiesValue001StringProperty Value

Request Example

{
    "padCodes": [
        "AC21020010001",
        "AC21020010002"
    ]
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts":1713773577581,
        "data": [
        {
            "padCode": "AC21020010001",
            "modemPropertiesList": [
                {
                    "propertiesName": "IMEI",
                    "propertiesValue": "412327621057784"
                }
            ],
            "systemPropertiesList": [
                {
                    "propertiesName": "ro.build.id",
                    "propertiesValue": "QQ3A.200805.001"
                }
            ],
            "settingPropertiesList": [
                {
                    "propertiesName": "ro.build.tags",
                    "propertiesValue": "release-keys"
                }
            ],
            "oaidPropertiesList": [
                {
                    "propertiesName": "oaid",
                    "propertiesValue": "001"
                }
            ]
        },
        {
            "padCode": "AC21020010002",
            "modemPropertiesList": [
                {
                    "propertiesName": "IMEI",
                    "propertiesValue": "412327621057784"
                }
            ],
            "systemPropertiesList": [
                {
                    "propertiesName": "ro.build.id",
                    "propertiesValue": "QQ3A.200805.001"
                }
            ],
            "settingPropertiesList": [
                {
                    "propertiesName": "ro.build.tags",
                    "propertiesValue": "release-keys"
                }
            ],
            "oaidPropertiesList": [
                {
                    "propertiesName": "oaid",
                    "propertiesValue": "001"
                }
            ]
        }
    ]
}

Error Codes

Error CodeError DescriptionSuggested Action
110028Instance does not existPlease check if the instance is correct

Modify Instance Properties

Dynamically modify the properties of an instance, including system properties and settings.

The instance needs to be powered on, and this interface takes effect immediately.

API Endpoint

/vcpcloud/api/padApi/updatePadProperties

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesString[]Yes
├─AC21020010001StringYesInstance Code
modemPropertiesListObject[]NoModem-Property List
├─propertiesNameIMEIStringYesProperty Name
├─propertiesValue412327621057784StringYesProperty Value
systemPropertiesListObject[]NoSystem-Property List
├─propertiesNamero.build.idStringYesProperty Name
├─propertiesValueQQ3A.200805.001StringYesProperty Value
settingPropertiesListObject[]NoSetting-Property List
├─propertiesNamero.build.tagsStringYesProperty Name
├─propertiesValuerelease-keysStringYesProperty Value
oaidPropertiesListObject[]NoOaid-Property List
├─propertiesNameoaidStringYesProperty Name
├─propertiesValue001StringYesProperty Value

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
ts1756021167163LongTimestamp
dataObject[]
├─taskId1IntegerTask ID
├─padCodeAC21020010001StringInstance Code
├─vmStatusIntegerInstance online status (0: Offline, 1: Online)

Request Example

{
    "padCodes": [
        "AC21020010001"
    ],
        "modemPersistPropertiesList": [
        {
            "propertiesName": "IMEI",
            "propertiesValue": "412327621057784"
        }
    ],
        "modemPropertiesList": [
        {
            "propertiesName": "IMEI",
            "propertiesValue": "412327621057784"
        }
    ],
        "systemPersistPropertiesList": [
        {
            "propertiesName": "ro.build.id",
            "propertiesValue": "QQ3A.200805.001"
        }
    ],
        "systemPropertiesList": [
        {
            "propertiesName": "ro.build.id",
            "propertiesValue": "QQ3A.200805.001"
        }
    ],
        "settingPropertiesList": [
        {
            "propertiesName": "ro.build.tags",
            "propertiesValue": "release-keys"
        }
    ],
        "oaidPropertiesList": [
        {
            "propertiesName": "oaid",
            "propertiesValue": "001"
        }
    ]
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts": 1717570916196,
        "data": [
        {
            "taskId": 36,
            "padCode": "AC22030010001",
            "vmStatus": 1
        }
    ]
}

Error Codes

Error CodeError DescriptionRecommended Action
110028Instance does not existPlease check if the instance is correct

Stop Stream

Stop the stream of the specified instance and disconnect the instance.

API Endpoint

/vcpcloud/api/padApi/dissolveRoom

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesString[]Yes
├─AC11010000031StringYesInstance ID
├─AC22020020700StringYesInstance ID

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
ts1756021167163LongTimestamp
dataObject[]
├─ successListObject[]Successful List
├─ ├─ padCodeAC11010000031StringInstance ID
├─ failListObject[]Failure List
├─ ├─ padCodeAC22020020700StringInstance ID
├─ ├─ errorCode120005IntegerError Code
├─ ├─ errorMsgInstance does not existStringFailure Reason

Request Example

{
    "padCodes": ["AC11010000031","AC22020020700"]
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts":1713773577581,
     "data": {
	 	  "successList": [
              {
                  "padCode": "AC11010000031"
              }
          ],
          "failList": [
		  	 {
                  "padCode": "AC22020020700",
				  "errorCode": 120005,
				  "errorMsg": "Instance does not exist"
              }
		  ]
     }
}

Error Codes

Error CodeError DescriptionSuggested Action
120005Instance does not existPlease check if the instance ID is correct
120004Stream stop error, command service exceptionPlease try again later

Modify Instance Android Device Properties

Description of the props field: This field is defined as key-value pairs.

API URL

/vcpcloud/api/padApi/updatePadAndroidProp

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodeAC32010210001StringYesInstance ID
restartfalseBooleanNoAutomatically restart after setting (default: false)
props{}ObjectYesSystem properties
├─ ro.product.vendor.nameOP52D1L1StringYesSystem property

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]
├─ taskId24LongTask ID
├─ padCodeAC32010210001StringInstance ID

Request Example

{
	"padCode": "AC32010210001",
	"props": {
		"ro.product.vendor.name": "OP52D1L1"
	},
	"restart": false
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1730192434383,
	"data": {
		"taskId": 11,
		"padCode": "AC32010210001"
	}
}

Instance Control

Asynchronous Execution of ADB Commands

Asynchronously execute commands on one or more cloud phone instances.

API URL

/vcpcloud/api/padApi/asyncCmd

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesString[]YesInstance IDs
├─AC22020020793StringYesInstance ID
scriptContentcd /root;lsStringYesADB command, separate multiple commands with a semicolon

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]
├─ taskId1IntegerTask ID
├─ padCodeAC22020020793StringInstance ID
├─ vmStatus1IntegerInstance status (0: offline; 1: online)

Request Example

{
    "padCodes": [
        "AC22020020793"
    ],
    "scriptContent": "cd /root;ls"
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570297639,
	"data": [
		{
			"taskId": 14,
			"padCode": "AC22030010001",
			"vmStatus": 1
		},
		{
			"taskId": 15,
			"padCode": "AC22030010002",
			"vmStatus": 0
		}
	]
}

Error Codes

Error CodeError DescriptionRecommended Action
110003ADB command execution failedContact the administrator
110012Command execution timed outPlease try again later

Synchronously Execute ADB Commands

Execute commands synchronously on one or more cloud phone instances.

Returns a timeout exception if there is no response after 5 seconds.

API URL

/vcpcloud/api/padApi/syncCmd

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodeAC22020020793StringYesInstance ID
scriptContentcd /root;lsStringYesADB command, multiple commands separated by semicolons

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]
├─taskId1IntegerTask ID
├─padCodeAC22020020793StringInstance ID
├─taskStatus3IntegerTask status (-1: all failed; -2: partially failed; -3: canceled; -4: timeout; 1: pending execution; 2: executing; 3: completed)
├─taskResultSuccessStringTask result

Request Example

{
    "padCode": "VP21020010231",
    "scriptContent": "cd /root/nbin;ls"
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts":1713773577581,
	"data":[
				{
				"taskId": 1,
				"padCode": "AC22020020793",
				"taskStatus":3,
				"taskResult":"Success"
				}
			]
}

Error Codes

Error CodeError DescriptionRecommended Action
110003ADB command execution failedPlease try again later
110012Command execution timeoutPlease try again later

Generate Preview Image

Generate a preview image for the specified instance.

API Endpoint

/vcpcloud/api/padApi/generatePreview

Request Method

POST

Request Data Type

application/json

Request Body Parameters

ParameterExample ValueParameter TypeRequiredDescription
padCodesString[]Yes
├─AC11010000031StringYesInstance ID
rotation0IntegerYesScreenshot orientation: 0 - No rotation (default); 1 - Rotate to portrait for landscape screenshot
broadcastfalseBooleanNoWhether the event is broadcasted (default is false)

Response Parameters

ParameterExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]
├─padCodeAC11010000031StringInstance ID
├─accessUrlhttp://xxx.armcloud.pngStringAccess URL for the preview image

Request Example

{
    "padCodes": [
        "AC11010000031"
    ],
    "rotation": 0,
    "broadcast": false
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts":1713773577581,
	"data": [
		{
			"padCode": "AC11010000031",
			"accessUrl": "http://xxx.armcloud.png"
		}
	]
}

Enable or disable ADB

Open or close instance adb according to instance number.

API Endpoint

/vcpcloud/api/padApi/openOnlineAdb

Request Method

POST

Request Data Type

application/json

Request Body Parameters

ParameterExample ValueParameter TypeRequiredDescription
padCodesString[]YesInstance list (input instance quantity 1-200)
├─padCodeAC32010140011StringYesInstance number
openStatustruebooleanYesEnable or disable ADB status (1 to enable, 0 or not to enable by default)

Response Parameters

ParameterExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─taskId16147Integertask id
├─padCodeAC32010250032StringInstance number
├─taskStatus3IntegerTask status (-1 all failed, -2 part failed, -3 canceled, -4 timed out, -5 abnormal, 1 waiting for execution, 2 executing, 3 completed)
├─taskResultsuccessStringTask results

Request Example

{
    "padCodes":[
        "AC32010250032"
    ],
    "status": 1
}

Response Example

{
    "code": 200,
    "msg": "success",
    "ts": 1736920929306,
    "data": [
        {
            "taskId": 16147,
            "padCode": "AC32010250032",
            "taskStatus": 3,
            "taskResult": "success"
        }
    ]
}

Get ADB connection information

Get adb connection information based on the instance number. If the response data (key, adb) is incomplete, call Enable/Disable ADB to enable adb.

API Endpoint

/vcpcloud/api/padApi/adb

Request Method

POST

Request Data Type

application/json

Request Body Parameters

ParameterExample ValueParameter TypeRequiredDescription
padCodesAC22030010124StringYesInstance ID
enabletruebooleanYestrue - Open, false - Close

Response Parameters

ParameterExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─padCodeAC32010140011StringInstance ID
├─commandadb connect ip:portIntegerADB connection info
├─expireTime2024-10-24 10:42:00StringConnection expiration time
├─enabletruebooleanADB status

Request Example

{
  "padCode": "AC22030010001",
  "enable": true
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1729651701083,
	"data": {
		"padCode": "AC32010161274",
		"command": "adb connect ip:port",
		"expireTime": "2024-10-24 10:42:00",
		"enable": true
	}
}

Update Contacts

Either fileUniqueId or info is required.

API Endpoint

/vcpcloud/api/padApi/updateContacts

Request Method

POST

Request Data Type

application/json

Request Body Parameters

ParameterExample ValueParameter TypeRequiredDescription
padCodes[]ArrayYesList of instance IDs
fileUniqueIdcfca25a2c62b00e065b417491b0cf07ffcStringNoContact file ID
infoObject[]NoContact information
├─firstNametomStringNoFirst name
├─phone13111111111StringNoPhone number
├─emailtom@gmail.comStringNoEmail address

Response Parameters

ParameterExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─taskId11IntegerTask ID
├─padCodeAC32010210001StringInstance ID
├─vmStatus0IntegerInstance online status (0: offline; 1: online)

Request Example

{
  "fileUniqueId": "cfca25a2c62b00e065b417491b0cf07ffc",
  "info": [{
    "firstName": "tom",
    "phone": "13111111111",
    "email": "tom@gmail.com"
  }],
  "padCodes": [
    "AC32010180326"
  ]
}

Response Example

{
  "code": 200,
  "msg": "success",
  "ts": 1730192434383,
  "data": [{
    "taskId": 11,
    "padCode": "AC32010210001",
    "vmStatus": 0
  }]
}

Set Proxy for Instance

API Endpoint

/vcpcloud/api/padApi/setProxy

Request Method

POST

Request Data Type

application/json

Request Body Parameters

ParameterExample ValueParameter TypeRequiredDescription
account2222StringNoAccount
password2222StringNoPassword
ip47.76.241.5StringNoIP
port2222IntegerNoPort
enabletrueBooleanYesEnable
padCodes[]ArrayYesList of instances
proxyTypevpnStringNoSupported values: proxy, vpn
proxyNamesocks5StringNoSupported values: socks5, http-relay (http, https)
bypassPackageListArrayNoPackage names that will bypass the proxy
bypassIpListArrayNoIPs that will bypass the proxy
bypassDomainListArrayNoDomains that will bypass the proxy

Response Parameters

ParameterExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─taskId24LongTask ID
├─padCodeAC22030010001StringInstance ID
├─vmStatus0IntegerInstance online status (0: offline; 1: online)

Request Example

{
  "padCodes": [
    "AC32010140023"
  ],
  "account": "2222",
  "password": "2222",
  "ip": "47.76.241.5",
  "port": 2222,
  "enable": true
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570663080,
	"data": [
		{
			"taskId": 24,
			"padCode": "AC32010140023",
			"vmStatus": 1
		}
	]
}

Get real machine templates by page

Get real machine templates by page

Interface address

/vcpcloud/api/padApi/templateList

Request method

POST

Request data type

application/json

Request Body parameters

Parameter nameExample valueParameter typeRequiredParameter description
page1IntegerYesPage number
rows10IntegerYesNumber of records per page

Response parameters

Parameter nameExample valueParameter typeParameter description
msgsuccessStringResponse message
code200IntegerStatus code
ts1736327056700LongTimestamp
dataObjectData details
├─ recordsObject[]Record list
│ ├─ goodFingerprintId127IntegerCloud device template ID
│ ├─ goodFingerprintNameSamsung Galaxy Note 20StringCloud device name
│ ├─ goodAndroidVersion13StringAndroid version
├─ total25IntegerTotal number of records
├─ size10IntegerNumber of records per page
├─ current1IntegerCurrent page number
├─ pages3IntegerTotal number of pages

Request example

{
"page": 1,
"rows": 10
}

Response example

{
    "msg": "success",
    "code": 200,
     "data": {
         "records": [
         {
             "goodFingerprintId": 127,
             "goodFingerprintName": "Samsung Galaxy Note 20",
             "goodAndroidVersion": "13",
         }
         ],
         "total": 25,
         "size": 10,
         "current": 1,
         "pages": 3
     },
     "ts": 1742454918332
}

One-Click New Device ⭐️

Interface URL

/vcpcloud/api/padApi/replacePad

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodes[]ArrayYesInstance list
countryCodeSGStringNoCountry code (for details, please refer to: https://chahuo.com/country-code-lookup.html)
realPhoneTemplateId65LongNoTemplate id reference Get real machine template by page
androidProp{"persist.sys.cloud.wifi.mac": "D2:48:83:70:66:0B"}ObjectNoReference Android modification property list

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─taskId12818LongTask ID
├─padCodeAC22030010001StringInstance ID
├─vmStatus0IntegerInstance online status (0: offline; 1: online)

Request Example

{ "padCodes": [
  "AC32010030001"
]
}

Response Example

{
  "code": 200,
  "msg": "success",
  "ts": 1732270378320,
  "data": {
    "taskId": 8405,
    "padCode": "AC32010030001",
    "vmStatus": 2
  }
}

Query the list of countries supported by one-click new machine

Interface address

/vcpcloud/api/padApi/country

Request method

GET

Request data type

application/json

Response parameters

Parameter nameExample valueParameter typeParameter description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─codeADStringCountry code
├─nameAndorraStringCountry name (English)

Response example

{
    "code": 200,
    "msg": "success",
    "ts": 1730192434383,
    "data": [{ 
        "code": "AD", 
        "name": "Andorra" 
    }]
}

Switch Device

Interface URL

/vcpcloud/api/padApi/replacement

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodeAC22030010001StringYesInstance

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─equipmentId358504LongEquipment number
├─padCodeAC32011030092StringInstance number

Request Example

{
    "padCode": "AC32010030001"
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": {
        "padCode": "AC32011030092",
        "equipmentId": 358504
    },
    "ts": 1741078432830
}

Modify Instance Time Zone

Interface URL

/vcpcloud/api/padApi/updateTimeZone

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
timeZoneAsia/ShanghaiStringYesUTC standard time
padCodes["AC22030010001"]ArrayYesInstance list

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─taskId12818LongTask ID
├─padCodeAC22030010001StringInstance ID
├─vmStatus1IntegerInstance online status (0: offline; 1: online)

Request Example

{
	"padCodes": [
		"AC32010140003"
	],
	"timeZone": "Asia/Shanghai"
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570663080,
	"data": [
		{
			"taskId": 12818,
			"padCode": "AC32010140003",
			"vmStatus": 1
		}
	]
}

Modify Instance Language

Interface URL

/vcpcloud/api/padApi/updateLanguage

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
languagezhStringYesLanguage
countryCNStringNoCountry
padCodes["AC22030010001"]ArrayYesInstance list

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─taskId12818LongTask ID
├─padCodeAC22030010001StringInstance ID
├─vmStatus1IntegerInstance online status (0: offline; 1: online)

Request Example

{
	"padCodes": [
		"AC32010140026"
	],
	"language": "zh",
	"country": ""
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570663080,
	"data": [
		{
			"taskId": 12818,
			"padCode": "AC32010140026",
			"vmStatus": 1
		}
	]
}

Modify sim card information according to country code

Static settings will take effect after the instance is restarted. You need to restart the instance to take effect. They are generally used to modify device information. This interface has the same function as the Modify instance Android modification properties interface. The difference is that this interface will generate additional sim card information and must be restarted every time.

After setting the instance attributes, the attribute changes will be stored persistently, and there is no need to call this interface again to restart or reset the instance.

Interface address

/vcpcloud/api/padApi/updateSIM

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodeAC32010210001StringYesPadCode
countryCodeUSStringNoCountry Code
props{}ObjectNoSystem properties (this field is key-value definition)
├─persist.sys.cloud.phonenum15166370000StringNoProperty settings

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200Integerstatus code
msgsuccessStringresponse message
ts1721739857317LongTimestamp
dataTASK-285633563817283584StringTask ID

Request Example

{
    "countryCode": "CN",
    "padCode": "AC32010950933",
    "props": {
        "persist.sys.cloud.phonenum": "15166370000"
    }
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": "TASK-285633563817283584",
    "ts": 1740631552342
}

File upload interface directly through link

Push files from the file management center to the cloud phone instance (asynchronous task) If the corresponding file can be found through the md5 value or file ID, it will be directly sent to the instance for download through the OSS path. If OSS does not have the corresponding file, the URL will be directly sent to the instance for download, and the URL content will be uploaded to OSS. If you choose to install the application, it will check whether the package name has a value. If there is no value, an exception will be thrown. (Installing the application will authorize all permissions by default, and you can choose not to authorize through the isAuthorization field) Request method

Interface address

/vcpcloud/api/padApi/uploadFileV3

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodeAC32010210001StringYesPadCode
autoInstall1IntegerNoWhether automatic installation is required: 1 required, 0 not required. If left blank, it is not required by default. Only effective for apk type files
fileUniqueId1e5d3bf00576ee8f3d094908c0456722StringNoThe unique identifier of the file id
customizeFilePath/Documents/StringNoCustom path. It is not required and must start with /.(Example:"/DCIM/", "/Documents/", "/Download/", "/Movies/", "/Music/", "/Pictures/")
fileNamethreadsStringNoFile name
packageNamecom.zhiliaoapp.musicallyStringNoFile package name
urlhttps://file.vmoscloud.com/appMarket/2/apk/fe1f75df23e6fe3fd3b31c0f7f60c0af.apkStringNoFile installation path
md51e5d3bf00576ee8f3d094908c0456722StringNofile unique identifier
isAuthorizationfalseBooleanNoWhether to authorize (default full authorization)
iconPathhttps://file.vmoscloud.com/appMarket/2/apk/fe1f75df23e6fe3fd3b31c0f7f60c0af.pngStringNoIcon display during installation

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringresponse message
ts1721739857317LongTimestamp
dataObject[]
├─padCodeAC22010020062StringPadCode
├─taskId1IntegerTask ID
├─vmStatus1IntegerInstance online status (0: offline; 1: online)

Request Example

{
    "padCodes": [
        "AC32010250022"
    ],
    "customizeFilePath": "/DCIM/",
    "md5": "d97fb05b3a07d8werw2341f10212sdfs3sdfs24",
    "url": "https://file.vmoscloud.com/appMarket/2/apk/fe1f75df23e6fe3fd3b31c0f7f60c0af.apk",
    "autoInstall": 1,
    "packageName": "com.zhiliaoapp.musically",
    "fileName": "market",
    "isAuthorization": false
}

Response Example

{
    "code": 200,
    "msg": "success",
    "ts": 1737431505379,
    "data": [
        {
            "taskId": 13469,
            "padCode": "AC32010250022",
            "vmStatus": 0
        }
    ]
}

Set keepalive application interface

Currently only supports Android 14

Interface address

/vcpcloud/api/padApi/setKeepAliveApp

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodesString[]Yes
├─padCodeAC32010250011StringNoInstance number
applyAllInstancesfalseBooleanYesWhether to apply all instance modes
appInfosObject[]No
├─serverNamecom.zixun.cmp/com.zixun.cmp.service.TaskServiceStringYescom.xxx.xxx (package name)/com.xxx.xxx.service.DomeService (full path of the service to be started)

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1736326542985LongTimestamp
dataObject[]Task data list
├─ taskId10074IntegerTask ID
├─ padCodeAC32010250011StringInstance number
├─ errorMsgnullStringError message (null means no error)

Request Example

{
    "padCodes": [
        "AC32010250011"
    ],
        "appInfos": [
        {
            "serverName": "com.zixun.cmp/com.zixun.cmp.service.TaskService"
        }
    ],
        "applyAllInstances": false
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts": 1736326542985,
        "data": [
        {
            "taskId": 10074,
            "padCode": "AC32010250011",
            "errorMsg": null
        }
    ]
}

Error code

Error codeError descriptionOperation suggestion
110065Parameter request is not compliant, please refer to the interface documentCheck parameters, refer to the interface document
120005Instance does not existPlease check whether the instance number is correct

Upload user image

Interface address

/vcpcloud/api/padApi/addUserRom

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
nameCloudROM-13StringYesROM name
updateLogupdateStringYesupdate log
androidVersion13StringYesandroid version
versionv1.0.0StringYesversion
downloadUrlhttps://file.vmoscloud.com/userFile/userRom/d281d848eff49adee2dda2475235b80b2.tarStringYesaddress
packageSize236978175StringyesSize (Unit: Byte)

Response Parameters

字段名示例值类型说明
code200IntegerStatus code
msgsuccessStringResponse message
ts1736326542985LongTimestamp
dataimg-2505287582886572Stringimage id

Request Example

{
    "name": "CloudROM-13-11",
    "updateLog": "update log",
    "androidVersion": "13",
    "version": "v1.0.0",
    "downloadUrl": "https://file.vmoscloud.com/userFile/userRom/d281d848eff49adee2dda2475235b80b2.tar", 
    "packageSize": 236978175,
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": "img-2505287582886572",
    "ts": 1748425758327
}

User Rom pagination

Interface address

/vcpcloud/api/padApi/userRomPage

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
nameCloudROM-13StringnoROM name
androidVersion13Stringnoupdate log
current1intyescurrent page
size10intyespage size

响应参数

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1736326542985LongTimestamp
dataObject
├─recordsObject[]
├─├─id1intrecord id
├─├─nameCloudROM-13-01Stringname
├─├─androidVersion13Stringandroid version
├─├─downloadUrl13Stringaddress
├─├─imageId13Stringimage id
├─├─packageSize236978175intsize(unit:Byte)
├─├─versionv1.0.0Stringversion
├─├─imageFailedRemarkStringreasion
├─total1inttotal
├─size10intpage size
├─current1intcurrent
├─pages1intpages

Request Example

{
    "name": "cloud", 
    "androidVersion": 13,  
    "current": 1,
    "size": 10 
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": {
        "records": [
            {
                "id": 27,
                "name": "CloudROM-13-01",
                "androidVersion": "13",
                "downloadUrl": "https://file.vmoscloud.com/userFile/userRom/d281d848eff49adee2dda2475235b80b2.tar",
                "imageId": "img-2505287929452799",
                "packageSize": 236978175,
                "updateLog": "update",
                "version": "v1.0.0",
                "imageFailedRemark": "下载文件失败: https://file.vmoscloud.com/userFile/userRom/d281d848eff49adee2dda2475235b80b2.tar",
            }
        ],
        "total": 2,
        "size": 10,
        "current": 1,
        "pages": 1
    },
    "ts": 1748428965816
}

Set Instance GPS Coordinates

Interface URL

/vcpcloud/api/padApi/gpsInjectInfo

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
longitude116.397455FloatYesLongitude (coordinate)
latitude39.909187FloatYesLatitude (coordinate)
padCodes["AC22030010001"]ArrayYesList of instance IDs

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─taskId12818LongTask ID
├─padCodeAC22030010001StringInstance ID
├─vmStatus1IntegerInstance online status (0: offline; 1: online)

Request Example

{
	"padCodes": [
		"AC22030010001"
	],
	"longitude": 116.397455,
	"latitude": 39.909187
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570663080,
	"data": [
		{
			"taskId": 12818,
			"padCode": "AC22030010001",
			"vmStatus": 1
		}
	]
}

Local Screenshot

Interface URL

/vcpcloud/api/padApi/screenshot

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodes[]String[]YesList of instance IDs
├─AC11010000031StringYesInstance ID
rotation0IntegerYesScreenshot orientation:
0: No rotation (default);
1: Rotate clockwise 90 degrees for landscape screenshots.
broadcastfalseBooleanYesWhether to broadcast the event (default is false)
definition50IntegerNoScreenshot clarity, range 0-100
resolutionHeight1920IntegerNoResolution height (greater than 1)
resolutionWidth1080IntegerNoResolution width (greater than 1)

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─ taskId12818LongTask ID
├─ padCodeAC11010000031StringInstance ID
├─ vmStatus1IntegerInstance online status (0: offline; 1: online)

Request Example

{
    "padCodes": [
        "1721739857317"
    ],
        "rotation": 0,
        "broadcast": false,
        "definition": 50,
        "resolutionHeight": 1920,
        "resolutionWidth": 1080
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts": 1717570337023,
        "data": [
        {
            "taskId": 12818,
            "padCode": "AC11010000031",
            "vmStatus": 1
        }
    ]
}

Upgrade Image

Interface URL

/vcpcloud/api/padApi/upgradeImage

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodes[]String[]YesList of instance IDs
├─AC22030010182StringYesInstance ID
imageIdmg-24061124017StringYesImage ID
wipeDatafalseBooleanYesWhether to wipe the instance data (data partition), true to wipe, false to keep

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─ taskId12818LongTask ID
├─ padCodeAC22030010182StringInstance ID
├─ errorMsg""StringError message (if any)

Request Example

{
    "padCodes": [
        "AC22030010182"
    ],
    "wipeData": false,
    "imageId": "mg-24061124017"
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts": 1718594881432,
        "data": [
        {
            "taskId": 63,
            "padCode": "AC22030010182",
            "errorMsg": null
        }
    ]
}

Upgrade Real Device Image

Batch real device image upgrade for instances

Interface URL

/vcpcloud/api/padApi/virtualRealSwitch

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodes[]String[]YesList of instance IDs
├─AC22030010182StringYesInstance ID
imageIdmg-24061124017StringYesImage ID
wipeDatafalseBooleanYesWhether to wipe the instance data (data partition), true to wipe, false to keep
realPhoneTemplateId178IntegerNoReal device template ID (required if upgradeImageConvertType=real)
upgradeImageConvertTypevirtualStringYesType of image conversion: "virtual" for virtual machine, "real" for cloud real device
screenLayoutId14IntegerNoScreen layout ID (required if upgradeImageConvertType=virtual)

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─ taskId12818LongTask ID
├─ padCodeAC22030010182StringInstance ID
├─ errorMsg""StringError message (if any)

Request Example

{
    "padCodes": [
        "AC32010210023"
    ],
        "imageId": "img-24112653977",
        "wipeData": true,
        "realPhoneTemplateId": 178,
        "upgradeImageConvertType": "virtual",
        "screenLayoutId": 14
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts": 1718594881432,
        "data": [
        {
            "taskId": 63,
            "padCode": "AC22030010182",
            "errorMsg": null
        }
    ]
}

Intelligent IP Proxy Check

Check whether the proxy IP is available and if the location information is correct

Interface URL

/vcpcloud/api/padApi/checkIP

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
host127.0.0.1StringYesProxy information (IP or host)
port8080IntegerYesProxy port (numeric type)
accountxxxxStringYesProxy username
passwordxxxxStringYesProxy password
typeSocks5StringYesProxy protocol type: Socks5, http, https
countryUSStringNoCountry - required when forcibly specified - parameters please refer to: ( curl -x http://username:password@ip:port https://ipinfo.io?token=registered_token ); When forced specification is used, the system will directly use the specified information and will not detect the proxy.
ip156.228.84.62StringNoip - required when forcibly specified
loc39.0438,-77.4874StringNoLongitude, latitude - required when forced to specify
cityAshburnStringNoCity - required when forcibly specified
regionVirginiaStringNoRegion - required when forced to specify
timezoneAmerica/New_YorkStringNoTime zone - required when forcibly specified

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]
├─ proxyLocationUS-Los AngelesStringLocation of the proxy
├─ publicIp62.112.132.92StringExit IP
├─ proxyWorkingtrueBooleanProxy check result: true if successful, false if failed

Request Example

{
    "host": "62.112.132.92",
    "port": 45001,
    "account": "xxxxxxxxxx",
    "password": "xxxxxxxx",
    "type": "Socks5"
    // "country": "US",
    // "ip": "156.228.84.62",
    // "loc": "39.0438,-77.4874", 
    // "city": "Ashburn", 
    // "region": "Virginia",
    // "timezone": "America/New_York"
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": {
        "proxyLocation": "US-Los Angeles",
        "publicIp": "62.112.132.92",
        "proxyWorking": true
    },
    "ts": 1737601218580
}

Set Intelligent IP

Set a smart IP for the cloud machine device, and the exit IP, SIM card information, GPS coordinates, time zone and other information in the cloud machine will automatically change to the country of origin of the agent (the device will restart after setting, and it will take effect within 1 minute after the restart is completed. At the same time, the device status will change to 119 - Initializing. After the task succeeds, fails, or times out, it will change to 100 - normal status. The task timeout time is 5 minutes)

Note: The intelligent IP information must first pass the detection via the check IP interface; direct setting may lead to incorrect country matching.

Interface URL

/vcpcloud/api/padApi/smartIp

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodesString[]YesList of instance IDs
├─AC22030010182StringYesInstance ID
host127.0.0.1StringYesProxy information (IP or host)
port8080IntegerYesProxy port (numeric type)
accountxxxxStringYesProxy username
passwordxxxxStringYesProxy password
typeSocks5StringYesProxy protocol type: Socks5, http, https
modevpnStringYesMode of the proxy: vpn / proxy

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
dataTASK-278784482960609280StringTask ID
msgsuccessStringResponse message
ts1721739857317LongTimestamp

Request Example

{
    "padCodes": [
        "AC32010160334"
    ],
    "host": "62.112.132.92",
    "port": 45001,
    "account": "xxxxxx",
    "password": "xxxxxxx",
    "type": "Socks5",
    "mode": "vpn"
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": "TASK-278784482960609280",
    "ts": 1737604726812
}

Cancel Intelligent IP

Cancel the smart IP and restore the exit IP, SIM card information, GPS coordinates, time zone and other information in the cloud machine (the device will restart after setting, and it will take effect within 1 minute after the restart is completed. At the same time, the device status will change to 119 - initializing. After the task succeeds, fails, or times out, it will change to 100 - normal status. The task timeout is 5 minutes)

Interface URL

/vcpcloud/api/padApi/notSmartIp

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
padCodesString[]YesList of instance IDs
├─AC22030010182StringYesInstance ID

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
dataTASK-278784482960609280StringTask ID
msgsuccessStringResponse message
ts1721739857317LongTimestamp

Request Example

{
    "padCodes": [
        "AC32010160334"
    ]
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": "TASK-278784482960609280",
    "ts": 1737604726812
}

Equipment task execution result query

Query task execution results using task number(Intelligent IP usage)

Interface URL

/vcpcloud/api/padApi/getTaskStatus

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
taskIdTASK-278784482960609280StringYESTask ID

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
dataObject[]Task results
├─padCodeAC32010150162StringInstance ID
├─taskStatusSuccessfullyStringTask status: Executing-executing、Successfully-has succeeded、Failed-has failed、Timedout-has timed out
├─taskType10010IntegerTask type: 10010-Set Smart IP、 10011-Cancel Smart IP
msgsuccessStringResponse message
ts1721739857317LongTimestamp

Request Example

{
    "taskId": "TASK-278784482960609280"
}

Response Example

{
    "msg": "success",
    "code": 200,
    "data": [
        {
            "padCode": "AC32010150162",
            "taskStatus": "Successfully",
            "taskType": 10010
        }
    ],
    "ts": 1738999472135
}

Switch Root Permission

Enable or disable root permission in one or more cloud phone instances. To switch root for a single app, the package name must be specified, otherwise an exception will be thrown.

API Endpoint

/vcpcloud/api/padApi/switchRoot

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesString[]YesList of instance codes (padCodes)
├─AC22020020793StringYesInstance code
globalRootfalseBooleanNoWhether to enable global root permission (default is false)
packageNamecom.zixun.cmpStringNoApplication package name (required for non-global root)
rootStatusroot开启状态IntegerYesRoot status, 0: disable, 1: enable

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1721739857317LongTimestamp
dataObject[]Data list
├─ taskId1LongTask ID
├─ padCodeAC22020020793StringInstance code
├─ vmStatus1IntegerInstance online status (0: offline, 1: online)

Request Example

{
    "padCodes": [
        "AC32010250002"
    ],
    "globalRoot": false,
    "packageName": "com.android.ftpeasys",
    "rootStatus": 0
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts": 1717570297639,
        "data": [
            {
                "taskId": 1,
                "padCode": "AC32010250002",
                "vmStatus": 1
            }
        ]
}


Error Codes

Error CodeError DescriptionSuggested Action
110003ADB command execution failedContact the administrator
110089Package name cannot be empty when enabling root for a single appThe package name must be provided when enabling root for a single app

Resource Management Related API

Instance List Informationrmation

Retrieve instance list information based on query conditions with pagination.

Interface URL

/vcpcloud/api/padApi/infos

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredParameter Description
page1IntegerYesPage number
rows10IntegerYesNumber of records per page
padTyperealStringNoInstance type (virtual: Virtual machine; real: Real device)
padCodesString[]NoList of instance IDs
├─AC22010020062StringYesInstance ID
groupIdsInteger[]NoList of instance group IDs
├─1IntegerNoInstance group ID

Response Parameters

Parameter NameExample ValueParameter TypeParameter Description
code200IntegerStatus code
msgsuccessStringResponse message
ts1713773577581LongTimestamp
dataObjectResponse data
├─ page1IntegerCurrent page
├─ rows10IntegerNumber of records per page
├─ size1IntegerNumber of records on the current page
├─ total1IntegerTotal number of records
├─ totalPage1IntegerTotal number of pages
├─ pageDataObject[]List of instances
├─ ├─ padCodeVP21020010391StringInstance ID
├─ ├─ padGradeq1-2StringInstance opening grade (q1-6 for six openings, q1-2 for two openings)
├─ ├─ padStatus10IntegerInstance status (10 for running, 11 for restarting, 12 for resetting, 13 for upgrading, 14 for abnormal, 15 for not ready)
├─ ├─ groupId0IntegerGroup ID
├─ ├─ idcCoded3c1f580c41525e514330a85dfdecda8StringData center code
├─ ├─ deviceIp192.168.0.0StringCloud device IP
├─ ├─ padIp192.168.0.0StringInstance IP
├─ ├─ appsString[]List of installed apps
├─ ├─ ├─ armcloud001StringStringInstalled app name

Request Example

{
	"page": 1,
	"rows": 10,
	"padCodes": [
		"AC21020010391"
	],
	"groupIds":[1]
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts":1713773577581,
	"data": {
		"page": 1,
		"rows": 1,
		"size": 1,
		"total": 1,
		"totalPage": 1,
		"pageData": [
			{
				{
				"padCode": "AC21020010391",
				"padGrade": "q2-4",
				"padStatus": 10,
				"groupId": 0,
				"idcCode": "8e61ad284bc105b877611e6fef7bdd17",
				"deviceIp": "172.31.2.34",
				"padIp": "10.255.1.19",
				"apps": [
					"armcloud001"
				]
			}
		]
	}
}

Application Management

App Start

Start an app on an instance based on the instance ID and app package name.

API Endpoint

/vcpcloud/api/padApi/startApp

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
pkgNamexxx.test.comStringYesPackage Name
padCodesString[]Yes
├─AC22010020062StringYesInstance Code

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
ts1756021167163LongTimestamp
dataObject[]
├─ taskId1IntegerTask ID
├─ padCodeAC22010020062StringInstance Code
├─ vmStatus1IntegerInstance Online Status (0: Offline; 1: Online)

Request Example

{
	"padCodes": [
		"AC22010020062"
	],
	"pkgName": "xxx.test.com"
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570663080,
	"data": [
		{
			"taskId": 24,
			"padCode": "AC22010020062",
			"vmStatus": 1
		}
	]
}

Error Codes

Error CodeError DescriptionRecommended Action
110008Failed to start the appRestart the cloud machine and try starting the app again

Stop App

Perform the operation of stopping an app on an instance based on the instance ID and app package name.

API Endpoint

/vcpcloud/api/padApi/stopApp

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
pkgNamexxx.test.comStringYesPackage Name
padCodesString[]YesInstance IDs
├─AC22010020062StringYesInstance ID

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
ts1756021167163LongTimestamp
dataObject[]Data List
├─taskId1IntegerTask ID
├─padCodeAC22010020062StringInstance ID
├─vmStatus1IntegerInstance Online Status (0: Offline; 1: Online)

Request Example

{
	"padCodes": [
		"AC22010020062"
	],
	"pkgName": "xxx.test.com"
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570663080,
	"data": [
		{
			"taskId": 24,
			"padCode": "AC22010020062",
			"vmStatus": 1
		}
	]
}

Error Codes

Error CodeError DescriptionSuggested Action
110010Failed to stop appRestart the cloud machine and close the app

Application Restart

Restart an application on an instance based on the instance ID and application package name.

API Endpoint

/vcpcloud/api/padApi/restartApp

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
pkgNamexxx.test.comStringYesPackage name
padCodesString[]YesInstance IDs
├─AC22010020062StringYesInstance ID

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]Response data
├─ taskId1IntegerTask ID
├─ padCodeAC22010020062StringInstance ID
├─ vmStatus1IntegerInstance online status (0: Offline; 1: Online)

Request Example

{
	"padCodes": [
		"AC22010020062"
	],
	"pkgName": xxx.test.com
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1717570663080,
	"data": [
		{
			"taskId": 24,
			"padCode": "AC22010020062",
			"vmStatus": 1
		}
	]
}

Error Codes

Error CodeError DescriptionSuggested Action
110009Failed to stop appRestart the cloud machine and close the app

Error Codes

Error CodeDescriptionSuggested Action
110009Application restart failedRestart the cloud machine and then start the application

Instance installed application list query

Query the instance installed application list information.

API Address:

/vcpcloud/api/padApi/listInstalledApp

Request Method:

POST

Request Data Type:

application/json

Request Body Parameters:

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesString[]YesInstance identifier list
├─AC22010020062StringYesInstance identifier
appNameString否Application name

Response Parameters:

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1713773577581LongTimestamp
dataObject[]
├─ padCodeAC22010020062StringInstance ID
├─ appsObject[]Application list
│ ├─ appNameTapTapStringApplication name
│ ├─ packageNamecom.taptap.globalStringApplication package name
│ ├─ versionName3.49.0-full.100000StringApplication version name
│ ├─ versionCode349001000StringApplication version code
│ ├─ appState0Integer0 Completed 1 Installing 2 Downloading

Request Example


{
    "padCodes": ["AC32010780841"],
    "appName": null
}

Response Example

{
    "msg": "success",
        "code": 200,
        "data": [
            {
                "padCode": "AC32010780841",
                "apps": [
                    {
                        "appName": "TapTap",
                        "packageName": "com.taptap.global",
                        "versionName": "3.49.0-full.100000",
                        "versionCode": "349001000",
                        "appState": 0
                    }
                ]
            }
        ], 
        "ts": 1740020993436
}

Task Management

Instance Operation Task Details

Query the detailed execution result of a specified instance operation task.

API Address:

/vcpcloud/api/padApi/padTaskDetail

Request Method:

POST

Request Data Type:

application/json

Request Body Parameters:

Parameter NameExample ValueParameter TypeRequiredDescription
taskIdsInteger[]YesList of task IDs
├─ taskId1IntegerYesTask ID

Response Parameters:

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]Subtask list details
├─ taskId1IntegerSubtask ID
├─ padCodeVP22020020793StringInstance identifier
├─ taskStatus2StringTask status (-1: all failed; -2: partial failure; -3: canceled; -4: timeout; 1: pending execution; 2: executing; 3: completed)
├─ endTime1713429401000LongSubtask end timestamp
├─ taskContent“”StringTask content
├─ taskResult“”StringTask result
├─ errorMsg“”StringError message

Request Example

{
	"taskIds":[1,2]
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1716283460673,
	"data": [
		{
			"taskId": 1,
			"padCode": "AC22030022441",
			"taskStatus": 2,
			"endTime": 1713429401000,
			"taskContent": null,
			"taskResult": null
		},
		{
			"taskId": 2,
			"padCode": "AC22030022442",
			"taskStatus": 2,
			"endTime": 1713429401001,
			"taskContent": null,
			"taskResult": null
		}
	]
}

File Task Details

Query the detailed execution result of a specified file task.

API Address:

/vcpcloud/api/padApi/fileTaskDetail

Request Method:

POST

Request Data Type:

application/json

Request Body Parameters:

Parameter NameExample ValueParameter TypeRequiredDescription
taskIdsInteger[]YesList of task IDs
├─ taskId1IntegerYesTask ID

Response Parameters:

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1756021167163LongTimestamp
dataObject[]Task list details
├─ taskId1IntegerSubtask ID
├─ appId134LongApplication ID
├─ fileUniqueIde2c07491309858c5cade4bfc44c03724StringUnique file identifier
├─ fileNamexx.apkStringFile name
├─ taskStatus2IntegerTask status (-1: all failed; -2: partial failure; -3: canceled; -4: timeout; 1: pending execution; 2: executing; 3: completed)
├─ endTime1713429401000LongSubtask end timestamp

Request Example

{
	"taskIds":[
		1,2
	]
}

Response Example

{
	"code": 200,
	"msg": "success",
	"ts": 1716283460673,
	"data": [
		{
			"taskId": 1,
			"appId": 134,
			"fileUniqueId": "e2c07491309858c5cade4bfc44c03724",
			"fileName": "xx.apk",
			"taskStatus": 2,
			"endTime": 1713429401000
		},
		{
			"taskId": 2,
			"appId": 135,
			"fileUniqueId": "e2c07491309858c5cade4bfc43c03725",
			"fileName": "xx.apk",
			"taskStatus": 2,
			"endTime": 1713429401001
		}
	]
}

Automation Management

When performing automated tasks, do not operate on the cloud machine by performing actions such as rebooting, resetting, upgrading the image, or replacing machines, as this could interfere with the automated tasks.

Automated Task List Query

Query the list of automated tasks.

API Endpoint

/vcpcloud/api/padApi/autoTaskList

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
taskIdsLong[]NoTask ID array
taskType1IntegerNoTask type: 1-login, 2-edit profile, 3-search short videos, 4-randomly browse videos, 5-publish video, 6-publish gallery
page1IntegerYesPage number
rows10IntegerYesNumber of records per page

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
ts1736327056700LongTimestamp
dataObjectData details
├─ recordsObject[]Record list
│ ├─ taskId115IntegerTask ID
│ ├─ userId14114IntegerUser ID
│ ├─ equipmentId106588IntegerEquipment ID
│ ├─ padCodeAC32010180421StringInstance ID
│ ├─ padNamezzzzzStringInstance name
│ ├─ taskType1IntegerTask type: 1-login, 2-edit profile, 3-search short videos, 4-randomly browse videos, 5-publish video, 6-publish gallery
│ ├─ taskNametestAddStringTask name
│ ├─ executionStatus0IntegerExecution status: -2-cancelled task, -1-failed, 0-pending, 1-in progress, 2-successful
│ ├─ plannedExecutionTime2025-01-09 00:00:00StringPlanned execution time
│ ├─ executionEndTimenullStringExecution end time
│ ├─ createdTime2025-01-08 14:25:01StringCreation time
│ ├─ failureReasonnullStringFailure reason
├─ total46IntegerTotal records
├─ size10IntegerNumber of records per page
├─ current1IntegerCurrent page
├─ pages5IntegerTotal pages

Request Example

{
    "page": 1,
    "rows": 10
}

Response Example

{
	"msg": "success",
	"code": 200,
	"data": {
		"records": [
			{
				"id": 121,
				"taskId": 121,
				"userId": 14114,
				"equipmentId": 106653,
				"padCode": "AC32010180522",
				"padName": "V04",
				"taskType": 1,
				"taskName": "testAdd",
				"executionStatus": 2,
				"plannedExecutionTime": "2025-01-08 18:02:00",
				"executionEndTime": "2025-01-08 18:08:11",
				"createdTime": "2025-01-08 18:01:03",
				"failureReason": null
			}
		],
		"total": 46,
		"size": 10,
		"current": 1,
		"pages": 5
	},
	"ts": 1736331989341
}

Create Automation Task

Create an automation task. Make sure to pass the correct device number (the cloud phone list interface will return the device number). The task is mainly bound to the device number. If a device swap occurs before execution, it will not affect task loss. (Asynchronous, the system will check if the TK app is installed on the cloud phone. If not, it will automatically download the TK app before executing the task. Do not manually operate the cloud phone during the TK download and task execution). The request parameters for different tasks may vary; examples will be provided.

API Endpoint

/vcpcloud/api/padApi/addAutoTask

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
taskNametestAddStringYesTask name
remarkstestStringNoRemarks
taskType1IntegerYesTask type: 1-login, 2-edit profile, 3-search short videos, 4-randomly browse videos, 5-publish video, 6-publish gallery
listObject[]YesTask list
├─ equipmentId106653IntegerYesEquipment ID
├─ padCodeAC32010180522StringYesInstance ID
├─ plannedExecutionTime2025-01-08 17:20:00StringYesPlanned execution time
├─ addInfoRefer to the request exampleJSONObjectYesTask parameters (Note: Follow the corresponding format based on the task type, otherwise the task will fail)

Request Example

{
    "taskName": "testAdd",
    "remarks": "test",
    "taskType": 1,
    "list": [
        {
            "equipmentId": 106653,
            "padCode": "AC32010180522",
            "plannedExecutionTime": "2025-01-08 17:20:00",
            "addInfo": {
                "password": "zhouxi12....",
                "username": "zzx833454@gmail.com"
            }
        }
    ]
}

Login Task Parameters (Task Type - taskType: 1)

Parameter NameExample ValueParameter TypeRequiredDescription
passwordzzxxxx@gmail.comStringYesAccount
usernamezzxxxx@gmail.comStringYesPassword

Edit Profile Task Parameters (Task Type - taskType: 2)

Parameter NameExample ValueParameter TypeRequiredDescription
linkhttps://xxxx.pngStringYesAvatar URL (greater than 250x250)
usernametestStringYesName

Search Short Video Task Parameters (Task Type - taskType: 3)

Parameter NameExample ValueParameter TypeRequiredDescription
tagTitleStringYesTag
timeout10IntegerYesViewing duration (seconds) Note: The maximum time is 2 hours, otherwise the task will time out and fail

Random Video Browsing Task Parameters (Task Type - taskType: 4)

Parameter NameExample ValueParameter TypeRequiredDescription
timeout10IntegerYesViewing duration (seconds) Note: The maximum time is 2 hours, otherwise the task will time out and fail
tag""StringNoTag

Publish Video Task Parameters (Task Type - taskType: 5)

Parameter NameExample ValueParameter TypeRequiredDescription
linkhttps://xxxxStringNoVideo OSS URL
copywritingtestStringYesCopywriting
productIdnullStringNoproduct id

Publish Image Gallery Task Parameters (Task Type - taskType: 6)

Parameter NameExample ValueParameter TypeRequiredDescription
links[https://xxxx]array[String]YesImage OSS URLs (up to ten images)
copywritingtestStringYesCopywriting
bgmbgmStringYesBackground music name

Video like and comment task parameters (task type - taskType: 7)

Parameter nameExample valueParameter typeRequiredParameter description
timeout10IntegerYesWatching time (seconds) Note: Up to 2 hours, otherwise the task will time out and fail
tag""StringNoTag
contents["wow"]array[String]NoComment content Note: Currently only 1 is supported, and it will be expanded later

Live broadcast heating task parameters (task type - taskType: 8)

Parameter nameExample valueParameter typeRequiredParameter description
timeout10IntegerYesWatching time (seconds) Note: Up to 2 hours, otherwise the task will time out and fail
liveRoomId"xlavandulax"StringYesAnchor ID
contents"wow"StringYesComment content

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code0IntegerStatus Code: 0 - Success
msgsuccessStringResponse Message
ts1736327056700LongTimestamp
dataObject {}Subtask list details
├─ taskIdsLong[]Task ID Array

Response Example

{
	"msg": "success",
	"code": 200,
	"taskIds": [
		116
	],
	"ts": 1736327380399
}

Automated Task Retry

Automated task retry.

API Endpoint

/vcpcloud/api/padApi/reExecutionAutoTask

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
taskIdsLong[]YesTask ID array
plannedExecutionTime2025-01-08 17:30:00DateYesPlanned execution time

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
dataObject {}Subtask list details
ts1736327056700LongTimestamp
├─ taskIdsLong[]New task ID array

Request Example

{
    "taskIds": [
        109
    ],
    "plannedExecutionTime": "2025-01-08 17:30:00"
}

Response Example

{
	"msg": "success",
	"code": 200,
	"taskIds": [
		118
	],
	"ts": 1736327771611
}

Automated Task Cancellationlation

Automated task cancellation.

API Endpoint

/vcpcloud/api/padApi/cancelAutoTask

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
taskIdsLong[]YesTask ID array

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus Code
msgsuccessStringResponse Message
ts1736327056700LongTimestamp

Request Example

{
    "taskIds": [
        118
    ]
}

Response Example

{
	"msg": "success",
	"code": 200,
	"ts": 1736327841671
}

Cloud Phone Management

Create Cloud Phone

Create a new cloud phone. (Note that the purchased product package must be available on the web platform, otherwise the purchase will fail.)

API Endpoint

/vcpcloud/api/padApi/createMoneyOrder

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
androidVersionNameAndroid13StringYesAndroid version: Android10、Android13, Android14
goodId1IntegerYesProduct ID (corresponding to the Product ID value of SKU Package List)
goodNum1IntegerYesProduct quantity
autoRenewtrueBooleanYesWhether to auto-renew (enabled by default)
equipmentId106626,106627StringYesRenewal device IDs (comma separated for multiple devices)

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataObject[]Data list
├─ id7644IntegerUnique data identifier
├─ orderIdVMOS-CLOUD173630666722957907StringOrder number
├─ equipmentId106662IntegerEquipment ID
├─ createTime2025-01-08 11:24:31StringCreation time
├─ creater14114StringCreator
ts1736306672346LongTimestamp

Request Example

{
    "androidVersionName": "Android13",
    "goodId": 1,
    "goodNum": 1,
    "autoRenew": true
}

Response Example

{
	"msg": "success",
	"code": 200,
	"data": [
		{
			"id": 7644,
			"orderId": "VMOS-CLOUD173630666722957907",
			"equipmentId": 106662,
			"createTime": "2025-01-08 11:24:31",
			"creater": "14114"
		}
	],
	"ts": 1736306672346
}

Cloud Phone List

Cloud phone list.

API Endpoint

/vcpcloud/api/padApi/userPadList

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodenullStringNoInstance code
equipmentIdsInteger[]NoArray of equipment IDs

Response Parameters

Parameter NameExample ValueParameter TypeDescription
code200IntegerStatus code
msgsuccessStringResponse message
ts1736235894274LongTimestamp
dataObject[]Data list
├─ padCodeAC32010180421StringCloud phone code
├─ deviceIp172.30.5.43StringCloud phone physical machine IP
├─ padIp10.254.21.225StringCloud phone virtual IP
├─ cvmStatus100IntegerCloud phone status (100 - normal, 101 - capturing screenshot, 102 - restarting, 103 - resetting, 104 - abnormal)
├─ screenshotLinkhttps://XXXXXX.pngStringCloud phone screenshot link
├─ equipmentId106626IntegerEquipment ID
├─ userId14114IntegerUser ID
├─ status1IntegerDevice status
├─ padNameV08StringCloud phone display name
├─ bootTime1735643626263LongCloud phone usage time
├─ cumulativeUseTimenullObjectTotal device usage time
├─ lastBackupTimenullObjectLast backup time
├─ maintainContentnullObjectMaintenance content
├─ goodId1IntegerProduct ID
├─ goodNamei18n_Android13-V08StringProduct name
├─ signExpirationTime2025-01-31 19:13:46StringSigned cloud phone expiration time
├─ signExpirationTimeTamp1738322026000LongSigned cloud phone expiration timestamp
├─ supplierType5StringSupplier type
├─ androidVersionAvatarhttps://XXXX.pngStringAndroid version avatar
├─ configNameV08StringProduct model name
├─ androidVersionAvatar2https://XXX.pngStringAndroid version avatar 2
├─ androidVersionAvatar3https://XXX.pngStringAndroid version avatar 3
├─ androidVersion13StringAndroid version
├─ authorizedUserIdnullObjectAuthorized user ID
├─ authorizedExpirationTimenullObjectAuthorization expiration time
├─ authorizedExpirationTimeTampnullObjectAuthorization expiration timestamp
├─ changeConfig1IntegerSupport for configuration change (0 - no, 1 - yes)
├─ createTime2024-12-31 19:13:46StringCreation time
├─ proxyIpnullObjectProxy IP address
├─ remarkStringRemark
├─ proxyIdnullObjectProxy IP information
├─ ipAddressnullObjectIP address location
├─ publicIpnullObjectPublic IP
├─ groupIdnullObjectGroup ID
├─ groupNamenullObjectGroup name
├─ groupSortnullObjectGroup sorting order

Cloud Phone Status

Status CodeDescription
99Loading
100Normal
101Getting Screenshot
102Rebooting
103Resetting
104Reboot Failed
105Reset Failed
106Maintenance
107Upgrading Image
108Migrating Instance
109Migration Failed
111Device Configuration
112Anti-Fraud Lockdown
113Config Change
114Over Selling
115Changing Zone
116Cleaning Memory
119Initializing Cloud Machine
120One-click New Machine Initialization
121Task Execution in Progress
201Backing Up
202Restoring

Request Example

{
    "padCode": null,
    "equipmentIds": [
        106626
    ]
}

Response Example

{
  "msg": "success",
  "code": 200,
  "ts": 1736235894274,
  "data": [
    {
      "padCode": "AC32010180421",
      "deviceIp": "172.30.5.43",
      "padIp": "10.254.21.225",
      "cvmStatus": 100,
      "screenshotLink": "https://XXXXXX.png",
      "equipmentId": 106626,
      "userId": 14114,
      "status": 1,
      "padName": "V08",
      "bootTime": 1735643626263,
      "cumulativeUseTime": null,
      "lastBackupTime": null,
      "maintainContent": null,
      "goodId": 1,
      "goodName": "i18n_Android13-V08",
      "signExpirationTime": "2025-01-31 19:13:46",
      "signExpirationTimeTamp": 1738322026000,
      "supplierType": "5",
      "androidVersionAvatar": "https://XXXX.png",
      "configName": "V08",
      "androidVersionAvatar2": "https://XXX.png",
      "androidVersionAvatar3": "https://XXX.png",
      "androidVersion": "13",
      "authorizedUserId": null,
      "authorizedExpirationTime": null,
      "authorizedExpirationTimeTamp": null,
      "changeConfig": 1,
      "createTime": "2024-12-31 19:13:46",
      "proxyIp": null,
      "remark": "",
      "proxyId": null,
      "ipAddress": null,
      "publicIp": null,
      "groupId": null,
      "groupName": null,
      "groupSort": null
    }
  ]
}

Cloud Phone Information Query

Query cloud phone information.

API Endpoint

/vcpcloud/api/padApi/padInfo

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueTypeRequiredDescription
padCodeAC32010180421StringYesInstance ID

Response Parameters

Parameter NameExample ValueTypeDescription
msgsuccessStringResponse Message
code200IntegerStatus Code
dataObjectResponse Data
├─ explainEnglishStringLanguage - Explanation
├─ simCountrySGStringSIM Card Country
├─ countrySGStringCountry
├─ padCodeAC32010180421StringInstance ID
├─ padTypeV08StringDevice Model
├─ bluetoothAddress3A:1F:4B:9C:2D:8EStringBluetooth Address
├─ initializationData{"explain":"English", ...}StringDevice Information
├─ groupId0StringGroup ID
├─ latitude1.3398StringLatitude
├─ ipAddressHong KongStringIP Address
├─ timeZoneAsia/SingaporeStringTime Zone
├─ publicIp192.169.96.14StringPublic IP
├─ phoneNumber+6510633153StringVirtual Phone Number
├─ androidVersionAndroid13StringAndroid Version
├─ wlanMac4c:7f:11:2f:a6:ccStringWLAN MAC Address
├─ padNameV08StringPad Name
├─ simIsoM1StringSIM Card ISO
├─ longitude103.6967StringLongitude
├─ operatorNumeric52503IntegerOperator Number
├─ padImei525036719631842StringIMEI
ts1736239152927LongTimestamp

Request Example

{
    "padCode": null
}

Response Example

{
	"msg": "success",
	"code": 200,
	"data": {
		"explain": "English",
		"simCountry": "SG",
		"country": "SG",
		"padCode": "AC32010180421",
		"padType": "V08",
		"bluetoothAddress": "3A:1F:4B:9C:2D:8E",
		"initializationData": "{\"explain\":\"English\",\"country\":\"SG\",\"simJson\":{\"simCountry\":\"SG\",\"operatorShortname\":\"M1\",\"imei\":\"979706209497838\",\"imsi\":\"525036719631842\",\"phonenum\":\"6510633153\",\"operatorNumeric\":\"52503\"},\"latitude\":\"1.3398\",\"timeZone\":\"Asia/Singapore\",\"language\":\"en\",\"longitude\":\"103.6967\"}",
		"groupId": "0",
		"latitude": "1.3398",
		"ipAddress": "Hong Kong",
		"timeZone": "Asia/Singapore",
		"publicIp": "192.169.96.14",
		"phoneNumber": "+6510633153",
		"androidVersion": "Android13",
		"wlanMac": "4c:7f:11:2f:a6:cc",
		"padName": "V08",
		"simIso": "M1",
		"longitude": "103.6967",
		"operatorNumeric": 52503,
		"padImei": "525036719631842"
	},
	"ts": 1736239152927
}

SKU Package List

Get the SKU package list.

API Endpoint

/vcpcloud/api/padApi/getCloudGoodList

Request Method

GET

Request Data Type

application/json

Response Parameters

Parameter NameExample ValueTypeDescription
msgsuccessStringResponse Message
code200IntegerStatus Code
dataObjectResponse Data
├─ androidVersionNameAndroid13StringAndroid Version Name
├─ cloudGoodsInfoObjectSKU Package Information
│ ├─ configsListProduct Model Information
│ │ ├─ configNameSamsung s23 ultraStringProduct Model Name
│ │ ├─ sellOutFlagfalseBooleanSold Out Flag
│ │ ├─ configBlurbTop technology, comparable to real machine supreme experience!StringProduct Model Description
│ │ ├─ defaultSelectionfalseBooleanDefault Selection Flag
│ │ ├─ reorder0IntegerSort Order
│ │ ├─ goodTimesListProduct Price Information
│ │ │ ├─ oldGoodPrice100IntegerOriginal Price
│ │ │ ├─ showContent1 dayStringProduct Duration Name
│ │ │ ├─ whetherFirstPurchasetrueBooleanFirst Purchase Flag
│ │ │ ├─ reorder1IntegerSort Order
│ │ │ ├─ goodPrice100IntegerProduct Price
│ │ │ ├─ equipmentNumber1IntegerProduct Shipping Equipment Quantity
│ │ │ ├─ goodTime1440IntegerProduct Duration (Minutes)
│ │ │ ├─ autoRenewtrueBooleanSupports Auto Renewal
│ │ │ ├─ recommendContentFirst purchase special offerStringRecommended Content
│ │ │ ├─ id27IntegerProduct ID
ts1737440589859LongTimestamp

Response Example

{
    "msg": "success",
        "code": 200,
        "data": [
        {
            "androidVersionName": "Android13",
            "cloudGoodsInfo": {
                "configs": [
                    {
                        "configName": "Samsung s23 ultra",
                        "sellOutFlag": false,
                        "configBlurb": "顶尖科技,媲美真机至尊体验!",
                        "defaultSelection": false,
                        "reorder": 0,
                        "goodTimes": [
                            {
                                "oldGoodPrice": 100,
                                "showContent": "1天",
                                "whetherFirstPurchase": true,
                                "reorder": 1,
                                "goodPrice": 100,
                                "equipmentNumber": 1,
                                "goodTime": 1440,
                                "autoRenew": true,
                                "recommendContent": "首购特惠",
                                "id": 27
                            }
                        ]
                    }
                ],
                "goodId": 1
            }
        }
    ],
        "ts": 1737440589859
}

Modify Real Machine ADI Template

Modify the cloud real machine ADI template by passing the cloud real machine template ID.

Prerequisites:

  • The instance must be created as a cloud real machine type.
  • The instance's specifications must match the target ADI template specifications.
  • The instance's Android version must match the target ADI Android version.

API Endpoint

/vcpcloud/api/padApi/replaceRealAdiTemplate

Request Method

POST

Request Data Type

application/json

Request BODY Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesString[]YesList of instance codes
├─AC22010020062StringYesInstance Code
wipeDatafalseBooleanYesWhether to wipe data
realPhoneTemplateId186LongYesCloud Real Machine Template ID

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataObjectResponse data
├─ taskId1IntegerTask ID
├─ padCodeAC21020010001StringInstance Code
├─ vmStatus1IntegerInstance online status (0: offline; 1: online)

Request Example

{
    "padCodes": ["AC32010250011"],
    "wipeData": true,
    "realPhoneTemplateId": 186
}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts": 1736326542985,
        "data": [{
        "taskId": 10074,
        "padCode": "AC32010250011",
        "errorMsg": null
    }]
}

Cloud machine simulated touch

The cloud machine simulates the touch interface. The result can be queried through the Instance operation task details interface.

API Endpoint

/vcpcloud/api/padApi/simulateTouch

Request Method

POST

Request Data Type

application/json

Request BODY Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodesObject[]YesInstance code that needs to trigger a click
├─ ACP250329MMRFCCTStringYesPad Code
width1080IntegerYesTouch container width
height1920IntegerYesTouch container height
positionsObject[]YesTouch coordinate collection
├─ actionType1IntegerYesOperation type (0: pressed; 1: lifted; 2: touching)
├─ x100floatYesx coordinate of click
├─ y100floatYesy coordinate of click
├─ nextPositionWaitTime100IntegerYesWhen there are multiple sets of coordinates, the waiting interval in milliseconds to trigger the next set of click coordinates

Response Example

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataObjectResponse data
├─ padCodeACP250329MMRFCCTStringPadCode
├─ taskId10004759Longtask id
├─ vmStatus0IntegerInstance online status (0: offline; 1: online)

Request Example

{
    "padCodes": [
        "ACP250329MMRFCCT"
    ],
    "width": 1080,
    "height": 1920,
    "positions": [
        {
            "actionType": 0,
            "x": 100,
            "y": 100,
            "nextPositionWaitTime": 20
        },
        {
            "actionType": 2,
            "x": 110,
            "y": 110,
            "nextPositionWaitTime": 22
        },
        {
            "actionType": 2,
            "x": 120,
            "y": 120,
            "nextPositionWaitTime": 23
        },
        {
            "actionType": 1,
            "x": 120,
            "y": 120
        }
    ]
}

Response Example

{
    "code": 200,
    "msg": "success",
    "ts": 1743676563784,
    "data": [
        {
            "taskId": 100059,
            "padCode": "ACP250329MMRFCCT",
            "vmStatus": 0
        },
        {
            "taskId": 100060,
            "padCode": "ACP250329MMRFCCT",
            "vmStatus": 0
        }
    ]
}

Android image version collection

Get the image set that can be upgraded on the current device

API Endpoint

/vcpcloud/api/padApi/imageVersionList

Request Method

POST

Request Data Type

application/json

Request BODY Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodeACP250329MMRFCCTStringYESPadCode

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringresponse message
code200Integerstatus code
dataObject[]Data list
├─ nowImgIdimg-25033129396StringCurrent device image version ID
├─ hasNewVersionfalseBooleanWhether there is an image version that can be upgraded.
├─ imageVersionListObject[]Image version list
├─├─ imageIdimg-25033129396StringImage version ID
├─├─ version20250401IntegerImage version
├─├─ versionName20250401StringImage version Name
├─├─ publishTypereleasedStringRelease type: released-stable, beta-latest
├─├─ imageIllustrateFixed the issue that the Coffee Meet Begal app cannot activate location servicesStringMirror update instructions
├─├─ romSdkint14IntegerAndroid version Code
├─├─ romSdkNameAndroid 14StringAndroid release notes

Request Example

{
    "padCode": "ACP250329MMRFCCT"
}

Response Example

{
    "msg": "success",
        "code": 200,
        "data": {
        "nowImgId": "img-25033129396",
        "imageManageList": [
            {
                "imageId": "img-25040148674",
                "version": 20250401,
                "versionName": "20250401",
                "publishType": "released",
                "imageIllustrate": "Fixed the issue that the Coffee Meet Begal app cannot activate location services",
                "romSdkint": 34,
                "romSdkName": "Android 14"
            },
            {
                "imageId": "img-25033136513",
                "version": 20250331,
                "versionName": "20250331",
                "publishType": "released",
                "imageIllustrate": "Expand the tool model to add a blacklist",
                "romSdkint": 34,
                "romSdkName": "Android 14"
            },
            {
                "imageId": "img-25040129277",
                "version": 20250401,
                "versionName": "20250401",
                "publishType": "released",
                "imageIllustrate": "termux supports root",
                "romSdkint": 29,
                "romSdkName": "Android 10"
            },
            {
                "imageId": "img-25040872272",
                "version": 30000013,
                "versionName": "30000013",
                "publishType": "beta",
                "imageIllustrate": "B",
                "romSdkint": 33,
                "romSdkName": "Android 13"
            },
            {
                "imageId": "img-25032893685",
                "version": 20250328,
                "versionName": "20250328",
                "publishType": "released",
                "imageIllustrate": "1.tools add language",
                "romSdkint": 33,
                "romSdkName": "Android 13"
            }
        ],
        "hasNewVersion": false
    },
    "ts": 1744181920213
}

Equipment Pre-sale Purchase

When stock is insufficient, you can use this API to pre-order a device (only applicable to cloud phone products with a rental period of 30 days or more). Once stock is replenished, the system will prioritize fulfilling pre-sale orders and automatically dispatch the devices. After the order is shipped, users will receive an email notification and an additional one-day usage bonus.

API Endpoint

/vcpcloud/api/padApi/createMoneyProOrder

Request Method

POST

Request Data Type

application/json

Request BODY Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
androidVersionNameAndroid13String是Android Version:Android10、Android13、Android14
goodId1Integer是Product ID (corresponding to the Product ID value of SKU Package List)
goodNum1Integer是Product Number
autoRenewtrueBoolean是Whether to automatically renew (default closed) true-on, false-off

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataVMOS-CLOUD174290228048631464StringPre-sale order number

Request Example

{
    "androidVersionName": "Android13",
    "goodId": 75,
    "goodNum": 1,
    "autoRenew": true
}

Response Example

{
	"msg": "success",
	"code": 200,
	"data": "VMOS-CLOUD174290228048631464",
	"ts": 1736306672346
}

Query pre-sale order result details

Query the details of pre-sale order results. You can query by pre-sale order number, order status (1-to be shipped 2-shipped, empty default all)

API Endpoint

/vcpcloud/api/padApi/queryProOrderList

Request Method

POST

Request Data Type

application/json

Request BODY Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
proBuyStatus2IntegerNo1-To be shipped 2-Shipment If empty, default to all
orderIdVMOS-CLOUD174290228048631464IntegerNoPre-sale order number

Response Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataObject[]Data list
├─ proBuyOrderIdVMOS-CLOUD174290228048631464StringPre-sale order number
├─ proBuyStatus2Integer1-To be shipped 2-Shipment
├─ proBuyNumber1IntegerPurchase quantity
├─ createTime2025-03-25 19:31:21Stringcreation time
├─ payTime2025-03-25 19:31:21Stringpayment time
├─ endTime2025-03-25 19:41:33StringShipping time
├─ orderPrice1399IntegerOrder Amount (cents)
├─ goodNameSamsung Galaxy A53StringDevice name
ts1736306672346LongTimestamp

Request Example

{
    "proBuyStatus": "2",
    "orderId": "VMOS-CLOUD174290228048631464"
}

Response Example

{
    "msg": "success",
        "code": 200,
        "data": [
        {
            "proBuyOrderId": "VMOS-CLOUD174290228048631464",
            "proBuyStatus": 2,
            "proBuyNumber": 1,
            "createTime": "2025-03-25 19:31:21",
            "payTime": "2025-03-25 19:31:21",
            "endTime": "2025-03-25 19:41:33",
            "orderPrice": 499,
            "goodName": "V08"
        },
        {
            "proBuyOrderId": "VMOS-CLOUD174323615535421664",
            "proBuyStatus": 2,
            "proBuyNumber": 1,
            "createTime": "2025-03-29 16:16:22",
            "payTime": "2025-03-29 16:16:22",
            "endTime": "2025-03-29 16:18:03",
            "orderPrice": 1399,
            "goodName": "Samsung Galaxy A53"
        }
    ],
        "ts": 1743239203460
}

SDK Token Issuance

Issue a temporary STS Token for user authentication to access the cloud mobile phone service.

Get SDK Temporary Token

API Endpoint

/vcpcloud/api/padApi/stsToken

Request Method

GET

Request Data Type

application/json

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataObjectData list
├─ token18df5803-48ce-4b53-9457-6a15feb1dacaStringSDK communication token

Response Example

{
    "code": 200,
    "msg": "success",
    "ts":1713773577581,
    "data": {
        "token": "18df5803-48ce-4b53-9457-6a15feb1daca"
    }
}

SDK Token Issuance (by padCode)

Issue a temporary STS Token for user authentication to access the cloud mobile phone service (the token can only be used for the specified padCode).

Get SDK Temporary Token by padCode

API Endpoint

/vcpcloud/api/padApi/stsTokenByPadCode

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
padCodeAC32010230001StringYesInstance ID (padCode)

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataObjectData list
├─ token18df5803-48ce-4b53-9457-6a15feb1dacaStringSDK communication token

Request Example

{"padCode":"AC32010230001"}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts":1713773577581,
        "data": {
        "token": "18df5803-48ce-4b53-9457-6a15feb1daca"
    }
}

Clear SDK Authorization Token

API Endpoint

/vcpcloud/api/padApi/clearStsToken

Request Method

POST

Request Data Type

application/json

Request Body Parameters

Parameter NameExample ValueParameter TypeRequiredDescription
token123StringYesThe token to be cleared

Response Parameters

Parameter NameExample ValueParameter TypeDescription
msgsuccessStringResponse message
code200IntegerStatus code
dataObjectData list

Request Example

{"token":1234}

Response Example

{
    "code": 200,
        "msg": "success",
        "ts":1713773577581,
        "data": null
}

Instance File Upload Callback

Usage Scenario

Customers need to configure the callback URL on the WEB platform. Once the configuration is successful, the system will automatically start receiving callback notifications by default.

FieldTypeExampleDescription
taskBusinessTypeInteger1009Task business type
taskIdInteger1Task ID
resultbooleantrueExecution result: true - success, false - failure
errorCodeStringError code
padCodeStringAC22030022001Instance identifier
fileIdStringcf08f7b685ab3a7b6a793b30de1b33ae34File ID

Example

{
    "errorCode": null,
    "fileId": "cfec132ab3c4e1aff5515c4467d9bbe460",
    "padCode": "AC22030022001",
    "result": true,
    "taskBusinessType": 1009,
    "taskId": 10659,
    "taskResult": "Success",
    "taskStatus": 3
}

Application Installation Callback

Usage Scenario

When a customer initiates an application installation, this callback interface notifies the customer about the installation status.

FieldTypeExampleDescription
taskBusinessTypeInteger1003Task business type
taskIdInteger1Task ID
appsObject[]Application information
├─ appIdInteger10001Application ID
├─ appNameStringdemoApplication name
├─ pkgNameStringcom.xxx.demoPackage name
├─ padCodeStringAC22030022001Instance identifier
├─ resultbooleantrueInstallation result flag. true: success, false: failure
├─ failMsgStringThis application is blacklisted and cannot be installedFailure message

Example

{
    "endTime": 1734939747000,
    "padCode": "AC22030022001",
    "taskBusinessType": 1003,
    "taskContent": "",
    "taskId": 10613,
    "taskResult": "Success",
    "taskStatus": 3
}

Application Uninstallation Callback

Usage Scenario

When a customer initiates an application uninstallation, this callback interface notifies the customer about the uninstallation status.

FieldTypeExampleDescription
taskBusinessTypeInteger1004Task business type
taskIdInteger1Task ID
appsObjectApplication information
├─ appIdInteger10001Application ID
├─ appNameStringdemoApplication name
├─ pkgNameStringcom.xxx.demoPackage name
├─ padCodeStringAC22030022001Instance ID
├─ resultbooleantrueInstallation result flag. true: success, false: failure

Example

{
    "endTime": 1734940052000,
    "padCode": "AC22030022001",
    "taskBusinessType": 1004,
    "taskContent": "",
    "taskId": null,
    "taskResult": "Success",
    "taskStatus": 3
}

Application Startup Callback

Usage Scenario

When a customer initiates an application startup, this callback interface notifies the customer about the startup status.

FieldTypeExampleDescription
taskBusinessTypeInteger1007Task business type
taskIdInteger1Task ID
taskStatusInteger3Task status (-1: All failed; -3: Canceled; -4: Timeout; 1: Pending; 2: In progress; 3: Completed)
padCodeStringAC22030022001Instance identifier
pkgNameStringxxx.test.comPackage name

Example

{
    "taskBusinessType": 1007,
    "packageName": "com.quark.browser",
    "padCode": "AC22030022001",
    "taskId": 10618,
    "taskStatus": 3
}

Application Stop Callback

Usage Scenario

When a customer initiates an application stop, this callback interface notifies the customer about the stop status.

FieldTypeExampleDescription
taskBusinessTypeInteger1005Task business type
taskIdInteger1Task ID
taskStatusInteger3Task status (-1: All failed; -3: Canceled; -4: Timeout; 1: Pending; 2: In progress; 3: Completed)
padCodeStringAC22030022001Instance identifier
pkgNameStringxxx.test.comPackage name

Example

{
    "taskBusinessType": 1005,
    "packageName": "com.quark.browser",
    "padCode": "AC22030022001",
    "taskId": 10618,
    "taskStatus": 3
}

Application Restart Callback

Usage Scenario

When a customer initiates an application restart, this callback interface notifies the customer about the restart status.

FieldTypeExampleDescription
taskBusinessTypeInteger1006Task business type
taskIdInteger1Task ID
taskStatusInteger3Task status (-1: All failed; -3: Canceled; -4: Timeout; 1: Pending; 2: In progress; 3: Completed)
padCodeStringAC22030022001Instance identifier
pkgNameStringxxx.test.comPackage name

Example

{
    "taskBusinessType": 1006,
    "packageName": "com.quark.browser",
    "padCode": "AC22030022001",
    "taskId": 10618,
    "taskStatus": 3
}

The callback is returned on the user image

Usage Scenario

The user image is uploaded, and the result is notified to the customer through this callback interface.

FieldTypeExampleDescription
taskBusinessTypeInteger4001Task business type
imageIdStringimg-2505244083302766image id
taskStatusInteger3Task status(-1:failed;3:Completed)
failMsgStirng3fail reason

Example

{
    "imageId": "img-2505244083302766",
    "taskBusinessType": 4001,
    "taskStatus": 3
}
Next
Error Code