https://open-api.51gcc.com
请求方法:
POST
| 参数名 | 是否必填 | 说明 | 参数值 |
|---|---|---|---|
| sn | 是 | 序列号或IMEI | 设备的序列号或IMEI |
| api_id | 是 | api_id | 42 |
| api_test | 是 | 是否模拟请求返回示例数据。1=是;0=否 | 1 |
| api_key | 是 | 用户中心的API密钥 | 自己的API密钥 查看秘钥 |
| 字段名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
| image | string | 设备图片 | https://snapi.51gcc.com/storage/site/no_name.png |
| key | string | 字段名 | model |
| text | string | 字段含义 | 型号 |
| value | string|array | 字段含义对应的查询结果 | iPhone XR |
| notice | string | 对value字段含义的补充说明 | 用于查询保修的凭证号码 |
| 状态码 | 说明 |
|---|---|
| 200 | 请求成功,服务器已成功处理了请求。 |
| 210 | 参数错误。 |
| 220 | 系统功能异常。 |
| 230 | 数据获取失败。 |
| 403 | 服务器拒绝请求。这可能是由于缺少必要的认证凭据(如API密钥)或权限不足。 |
| 404 | 请求的资源未找到。请检查您的请求地址是否正确。 |
| 429 | 请求过于频繁。您已超出速率限制,请稍后再试。 |
| 500 | 服务器内部错误。服务器在执行请求时遇到了问题。 |
| 600 | API账户余额不足。 |
<?php
$url = 'https://open-api.51gcc.com';
$params = ['sn' => 'YOUR_VALUE', 'api_id' => '42', 'api_test' => 'YOUR_VALUE', 'api_key' => 'YOUR_VALUE', ];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>import requests
url = "https://open-api.51gcc.com"
params = {
'sn': 'YOUR_VALUE',
'api_id': '42',
'api_test': 'YOUR_VALUE',
'api_key': 'YOUR_VALUE',
}
response = requests.post(url, data=params)
print(response.text)import java.io.*;
import java.net.*;
import java.util.*;
public class ApiClient {
public static void main(String[] args) throws Exception {
String url = "https://open-api.51gcc.com";
Map<String, String> params = new HashMap<>();
params.put("sn", "YOUR_VALUE");
params.put("api_id", "42");
params.put("api_test", "YOUR_VALUE");
params.put("api_key", "YOUR_VALUE");
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setDoOutput(true);
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0) postData.append('&');
postData.append(URLEncoder.encode(param.getKey(), "UTF-8"));
postData.append('=');
postData.append(URLEncoder.encode(param.getValue(), "UTF-8"));
}
try (DataOutputStream wr = new DataOutputStream(con.getOutputStream())) {
wr.writeBytes(postData.toString());
}
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
}
}扫码联系客服