Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
This API is used to query profiles you have requested.
Protocol | HTTPS GET |
|---|---|
Direction | Your server -> Huawei server |
URL | https://connect-api.cloud.huawei.com/api/publish/v3/provision/list |
Data Format | Request: Content-Type: application/json Response: Content-Type: application/json |
This API supports both the API client and OAuth client modes. For details about their differences, please refer to Obtaining Authorization from the Server.
Service Account mode
Parameter | Mandatory | Type | Description |
|---|---|---|---|
Authorization | Yes | String | Authorization information in Authorization: Bearer ${JWT} format. Here JWT is the authentication token obtained when you obtain authorization using the Service Account mode. |
appId | Yes | String(32) | App ID. For details about how to obtain the app ID, please refer to Viewing App Information. |
provisionId | No | String | Profile ID. |
API client mode
Parameter | Mandatory | Type | Description |
|---|---|---|---|
client_id | Yes | String | Client ID. For details about how to obtain the value, please refer to Creating an API Client. |
Authorization | Yes | String | Authorization information in Authorization: Bearer ${access_token} format. In the format, access_token is obtained in Obtaining a Token. |
appId | Yes | String(32) | App ID. For details about how to obtain the app ID, please refer to Viewing App Information. |
provisionId | No | String | Profile ID. |
OAuth client mode
Parameter | Mandatory | Type | Description |
|---|---|---|---|
teamId | Yes | String(64) | ID of the team that you belong to. |
oauth2Token | Yes | String | Authorization information. Pass the access token obtained via the API for obtaining an access token. |
appId | Yes | String(32) | App ID. For details about how to obtain the app ID, please refer to Viewing App Information. |
provisionId | No | String | Profile ID. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
fromRecCount | No | Integer(32) | Start page number. Default value: 1 |
maxReqCount | No | Integer(32) | Number of records returned on each page. Value range: 1 to 100 Default value: 10 |
- GET /api/publish/v3/provision/list?fromRecCount=1&maxReqCount=100 HTTP/1.1
- Host: connect-api.cloud.huawei.com
- client_id: 41******68
- Content-Type: application/json
- Authorization: Bearer ******
- appId: 691****117
- provisionId: 1443****504
Parameter | Mandatory | Type | Description |
|---|---|---|---|
ret | Yes | Result code and description. | |
totalCount | No | Integer(32) | Total number of records. |
provisionList | No | List<ProvisionInfo> | Profile information. |
- {
- "ret": {
- "code": 0,
- "msg": "success"
- },
- "totalCount": 0,
- "provisionList": [
- {
- "id": "14***************04",
- "provisionName": "testProvision",
- "provisionType": 1,
- "certName": "0614-debug",
- "deviceList": [
- {
- "id": "14***************80",
- "deviceName": "de******me",
- "udid": "111111111222****************************************333333444444",
- "deviceType": 1,
- "createTime": "2024-06-14 11:55:28.676"
- }
- ],
- "aclPermissionList": [
- ""
- ],
- "aclPermissionAuditState": 0,
- "provisionDownloadUrl": "https://****/CN/2024061412/1718367940748-6ef9436f-6cd0-4b65-a1df-62174c795b40.p7b?X-Amz-Algorithm=****",
- "updateTime": 1718363106749,
- "expireTime": 1844598288000,
- "appId": "69****117"
- }
- ]
- }
Java sample code:
- public static JSONObject getProvisionList(String domain, String clientId, String token, String appId,
- String provisionId, Integer fromRecCount, Integer maxReqCount) {
- HttpGet get = new HttpGet(
- domain + "/publish/v3/provision/list?fromRecCount=" + fromRecCount + "&maxReqCount=" + maxReqCount);
-
- get.setHeader("Authorization", "Bearer " + token);
- get.setHeader("client_id", clientId);
- get.setHeader("appId", appId);
- get.setHeader("provisionId", provisionId);
-
- try {
- CloseableHttpClient httpClient = HttpClients.createDefault();
- CloseableHttpResponse httpResponse = httpClient.execute(get);
- int statusCode = httpResponse.getStatusLine().getStatusCode();
- if (statusCode == HttpStatus.SC_OK) {
- BufferedReader br = new BufferedReader(
- new InputStreamReader(httpResponse.getEntity().getContent(), Consts.UTF_8));
- String result = br.readLine();
-
- return JSON.parseObject(result);
- }
- } catch (Exception ignored) {
-
- }
- return null;
- }