应用
版本:v1
认证方式:Bearer Token
目录
接口列表
应用详情
接口说明
根据应用Key获取应用的详细信息和属性。
基本信息
- 接口名称:应用详情
- 请求方式:GET
- 请求路径:/App/{appKey}/Info
请求参数
Path 参数
参数名 |
示例值 |
参数描述 |
是否必填 |
appKey |
- |
- |
是 |
Query 参数
参数名 |
类型 |
示例值 |
参数描述 |
是否必填 |
propCode |
string |
- |
属性代码 |
否 |
示例代码
| import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;
public class ApiClient {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("{server}/App/{appKey}/Info"))
.header("Authorization", "Bearer {your_access_token}");
requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());
try {
HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
| import requests
url = "{server}/App/{appKey}/Info"
headers = {
"Authorization": "Bearer {your_access_token}"
}
response = requests.get(
url,
headers=headers
)
print(response.json())
|
| package main
import (
"fmt"
"io/ioutil"
"net/http"
"bytes"
"encoding/json"
)
func main() {
client := &http.Client{}
var req *http.Request
var err error
req, err = http.NewRequest("get", "{server}/App/{appKey}/Info", nil)
if err != nil {
panic(err)
}
req.Header.Add("Authorization", "Bearer {your_access_token}")
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}
|
| const axios = require('axios');
const config = {
method: 'get',
url: '{server}/App/{appKey}/Info',
headers: {
'Authorization': 'Bearer {your_access_token}'
}
};
axios(config)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
|
| <?php
$url = "{server}/App/{appKey}/Info";
$headers = [
"Authorization: Bearer {your_access_token}"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");
$response = curl_exec($ch);
curl_close($ch);
echo $response;
|
| using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;
class Program
{
static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");
HttpResponseMessage response;
response = await client.getAsync("{server}/App/{appKey}/Info");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
}
|
| require 'net/http'
require 'json'
uri = URI("{server}/App/{appKey}/Info")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"
response = http.request(request)
puts response.body
|
| fetch("{server}/App/{appKey}/Info", {
method: "get",
headers: {
"Authorization": "Bearer {your_access_token}"
}
})
.then(response => response.json())
.catch(error => console.error(error));
|
| import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;
public class ApiClient {
private final OkHttpClient client = new OkHttpClient();
public void makeRequest() {
Request.Builder requestBuilder = new Request.Builder()
.url("{server}/App/{appKey}/Info")
.addHeader("Authorization", "Bearer {your_access_token}");
requestBuilder.method("get", null);
try (Response response = client.newCall(requestBuilder.build()).execute()) {
System.out.println(response.body().string());
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
| import Foundation
let url = URL(string: "{server}/App/{appKey}/Info")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data {
if let json = try? JSONSerialization.jsonObject(with: data) {
print(json)
}
}
}
task.resume()
|
返回结果
| {
"code": 200 // 状态码,
"data": {
"info": {
"appKey": "",
"id": "0",
"name": "",
"logo": "",
"tags": "",
"website": "",
"description": "",
"projectID": "0"
},
"props": [
{
"code": "",
"value": "",
"desc": ""
}
]
},
"error": "" // 错误信息
}
|
字段名 |
类型 |
描述 |
是否必填 |
code |
integer |
状态码 |
否 |
data |
AppInfoResult |
- |
否 |
error |
string |
错误信息 |
否 |
数据结构
AppInfoItem
| {
"appKey": "",
"id": "0",
"name": "",
"logo": "",
"tags": "",
"website": "",
"description": "",
"projectID": "0"
}
|
字段名 |
类型 |
描述 |
是否必填 |
appKey |
string |
- |
否 |
id |
integer |
- |
否 |
name |
string |
- |
否 |
logo |
string |
- |
否 |
tags |
string |
- |
否 |
website |
string |
- |
否 |
description |
string |
- |
否 |
projectID |
integer |
- |
否 |
AppInfoResult
| {
"info": {
"appKey": "",
"id": "0",
"name": "",
"logo": "",
"tags": "",
"website": "",
"description": "",
"projectID": "0"
},
"props": [
{
"code": "",
"value": "",
"desc": ""
}
]
}
|
字段名 |
类型 |
描述 |
是否必填 |
info |
- |
- |
否 |
props |
array |
- |
否 |
AppInfoResultApiResponse
| {
"code": 200 // 状态码,
"data": {
"info": {
"appKey": "",
"id": "0",
"name": "",
"logo": "",
"tags": "",
"website": "",
"description": "",
"projectID": "0"
},
"props": [
{
"code": "",
"value": "",
"desc": ""
}
]
},
"error": "" // 错误信息
}
|
字段名 |
类型 |
描述 |
是否必填 |
code |
integer |
状态码 |
否 |
data |
- |
- |
否 |
error |
string |
错误信息 |
否 |
AppProperty
| {
"code": "",
"value": "",
"desc": ""
}
|
字段名 |
类型 |
描述 |
是否必填 |
code |
string |
- |
否 |
value |
string |
- |
否 |
desc |
string |
- |
否 |
通用错误码