Consulte la définition d'une API spécifiée.
Description de l'opération
Cette opération est destinée aux utilisateurs qui publient des API.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
apigateway:DescribeApi |
get |
*ApiGroup
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| GroupId |
string |
Non |
L'identifiant du groupe qui contient l'API. |
123 |
| ApiId |
string |
Oui |
L'identifiant de l'API. |
8afff6c8c4c6447abb035812e4d66b65 |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| ApiId |
string |
L'identifiant de l'API. |
8afff6c8c4c6447abb035812e4d66b65 |
| ResultType |
string |
Format de la réponse renvoyée par le service backend. Valeurs valides : JSON, TEXT, BINARY, XML et HTML. |
JSON |
| WebSocketApiType |
string |
Type d'API de communication bidirectionnelle :
|
COMMON |
| DisableInternet |
boolean |
Indique si l'API prend en charge uniquement les appels sur le réseau interne. Valeurs valides :
|
false |
| ResultBodyModel |
string |
Corps de réponse de l'API. |
{} |
| ResultSample |
string |
Exemple de réponse renvoyée par le service backend. |
200 |
| AppCodeAuthType |
string |
Valide uniquement lorsque AuthType est défini sur APP. Valeurs valides :
|
HEADER |
| AllowSignatureMethod |
string |
Obligatoire lorsque AuthType est défini sur APP. Spécifie l'algorithme de signature. Valeurs valides : HmacSHA256 et HmacSHA1,HmacSHA256. Valeur par défaut : HmacSHA256.
|
HmacSHA256 |
| RegionId |
string |
L'identifiant de la région où réside l'API. |
cn-qingdao |
| ForceNonceCheck |
boolean |
Indique si l'en-tête de requête X-Ca-Nonce est requis. Cet en-tête est l'identifiant unique de la requête, généralement un UUID. API Gateway valide cet en-tête pour empêcher les attaques par rejeu. Chaque valeur ne peut être utilisée qu'une seule fois dans un délai de 15 minutes. Valeurs valides :
|
true |
| Visibility |
string |
Indique si l'API est publique. Valeurs valides :
|
PUBLIC |
| FailResultSample |
string |
Exemple de réponse d'erreur renvoyée par le service backend. |
400 |
| AuthType |
string |
Type d'authentification de sécurité pour l'API. Valeurs valides :
|
APP |
| ModifiedTime |
string |
Heure de la dernière modification de l'API. |
2016-07-28T13:13:12Z |
| RequestId |
string |
L'identifiant de la requête. |
D0FF585F-7966-40CF-BC60-75DB070B23D5< |
| Description |
string |
Description de l'API. |
Description de l'API |
| GroupName |
string |
Nom du groupe contenant l'API. |
ApiTest |
| GroupId |
string |
L'identifiant du groupe qui contient l'API. |
08ae4aa0f95e4321849ee57f4e0b3077 |
| Mock |
string |
Indique si le mode mock est activé. Valeurs valides :
|
CLOSED |
| MockResult |
string |
Réponse mock. |
résultat de test |
| CreatedTime |
string |
Heure de création de l'API. |
2016-07-28T09:50:43Z |
| ApiName |
string |
Nom de l'API. Doit être unique au sein du groupe. |
ApiName |
| BackendEnable |
boolean |
Indique si le service backend est activé. |
true |
| BackendConfig |
object |
Configuration du backend. |
|
| BackendId |
string |
L'identifiant du service backend. |
0038e00c3dca44fcba3a94015d8f5bbf |
| BackendType |
string |
Type du service backend. |
HTTP |
| BackendName |
string |
Nom du service backend. |
testoss |
| RequestConfig |
object |
Configuration des requêtes envoyées par les consommateurs à API Gateway. |
|
| BodyModel |
string |
Modèle de corps. |
https://apigateway.aliyun.com/models/3a240a127dcc4afd9ab1bf7e947b4095/9e2df550e85b4121a79ec33e2619eaab |
| RequestPath |
string |
Chemin de l'API. Par exemple, si l'URL complète est |
/api/billing/test/[type] |
| RequestHttpMethod |
string |
Méthode HTTP. Valeurs valides : GET, POST, DELETE, PUT, HEAD, TRACE, PATCH, CONNECT et OPTIONS. |
POST |
| BodyFormat |
string |
Valide uniquement lorsque RequestMode est MAPPING. Indique comment les données sont envoyées au serveur pour les requêtes POST ou PUT. Valeurs valides : FORM (paires clé-valeur) et STREAM (flux d'octets). Lorsque vous envoyez une requête POST ou PUT, ce paramètre indique comment les données sont envoyées au serveur. Les valeurs valides sont FORM et STREAM, qui correspondent respectivement au format de formulaire (paires clé-valeur) et au format de flux d'octets. |
STREAM |
| RequestMode |
string |
Mode de mappage des requêtes. Valeurs valides : MAPPING (mappe les paramètres d'entrée) et PASSTHROUGH (transmet les paramètres d'entrée sans modification). |
MAPPING |
| PostBodyDescription |
string |
Description du corps de la requête. |
fwefwef |
| RequestProtocol |
string |
Protocoles pris en charge pour l'API. Plusieurs valeurs sont séparées par des virgules, comme HTTP,HTTPS. Valeurs valides : HTTP et HTTPS. |
HTTP |
| EscapePathParam |
boolean |
Indique s'il faut échapper les paramètres de chemin. Si true, les paramètres comme [param] dans le chemin sont traités comme des caractères littéraux. |
true |
| ServiceConfig |
object |
Configuration des requêtes envoyées d'API Gateway au service backend. |
|
| AoneAppName |
string |
Nom de l'application Aone. |
ib-blank |
| MockStatusCode |
integer |
Code d'état renvoyé par les réponses mock. |
200 |
| ContentTypeValue |
string |
Valeur de l'en-tête Content-Type lorsque ContentTypeCatagory est DEFAULT ou CUSTOM. |
application/x-www-form-urlencoded; charset=UTF-8 |
| ServiceProtocol |
string |
Protocole utilisé pour se connecter au service backend. Valeurs valides : HTTP et HTTPS. |
HTTP |
| ServicePath |
string |
Chemin utilisé pour appeler le service backend. Par exemple, si l'URL complète est |
/object/add |
| ContentTypeCatagory |
string |
Stratégie de définition de l'en-tête Content-Type lors de l'appel d'un service backend HTTP :
|
CUSTOM |
| ServiceAddress |
string |
Point de terminaison utilisé pour appeler le service backend. Par exemple, si l'URL complète est |
http://api.a.com:8080 |
| Mock |
string |
Indique si le mode mock est activé. Valeurs valides :
|
TRUE |
| ServiceVpcEnable |
string |
Indique si le canal VPC est activé. Valeurs valides :
|
TRUE |
| MockResult |
string |
Réponse renvoyée lorsque le mode mock est activé. |
résultat de test |
| ServiceHttpMethod |
string |
Méthode HTTP utilisée pour appeler le service backend. Valeurs valides : GET, POST, DELETE, PUT, HEAD, TRACE, PATCH, CONNECT et OPTIONS. |
POST |
| ServiceTimeout |
integer |
Délai d'expiration pour le service backend, en millisecondes. |
1000 |
| MockHeaders |
object |
||
| MockHeader |
array<object> |
Mock headers. |
|
|
object |
|||
| HeaderValue |
string |
Value of the HTTP header parameter. |
86400 |
| HeaderName |
string |
Name of the HTTP header parameter. |
Content-Length |
| VpcConfig |
object |
Configuration du canal VPC. |
|
| VpcId |
string |
ID of the VPC. |
vpc-2zeafsc3fygk1*** |
| VpcScheme |
string |
VPC protocol. |
HTTP |
| InstanceId |
string |
ID of the instance (ECS or Server Load Balancer) in the VPC. |
i-bp1h497hkijewv2*** |
| Port |
integer |
Port number of the instance. |
8080 |
| Name |
string |
Name of the VPC authorization. |
glmall-app-test |
| FunctionComputeConfig |
object |
Configuration backend pour Function Compute. |
|
| FcType |
string |
Function Compute service type. |
HttpTrigger |
| RoleArn |
string |
ARN of the RAM role that grants API Gateway permission to access Function Compute. |
acs:ram::111***:role/aliyunserviceroleforsas |
| Method |
string |
HTTP method. |
GET |
| FcBaseUrl |
string |
Root path of the Function Compute service. |
https://1227****64334133.ap-southeast-1-int***al.fc.aliyuncs.com/201****-15/proxy/test****ice.LATEST/testHttp/ |
| ContentTypeValue |
string |
Value of the Content-Type header when ContentTypeCatagory is DEFAULT or CUSTOM. |
application/x-www-form-urlencoded; charset=UTF-8 |
| RegionId |
string |
Region where Function Compute resides. |
cn-qingdao |
| OnlyBusinessPath |
boolean |
Specifies whether only the business path is passed to the backend. |
false |
| FunctionName |
string |
Name of the Function Compute function. |
edge_function |
| ContentTypeCatagory |
string |
Strategy for setting the Content-Type header when calling a Function Compute backend service:
|
DEFAULT |
| Path |
string |
API request path. |
/api/offline/cacheData |
| ServiceName |
string |
Name of the Function Compute service. |
fcservicename |
| Qualifier |
string |
Alias of the function. |
2 |
| TriggerName |
string |
The name of the trigger. You can specify the TriggerName or TriggerUrl parameter. The TriggerName parameter is optional. |
|
| FcVersion |
string |
||
| OssConfig |
object |
Configuration backend OSS. |
|
| Key |
string |
Path to the object or folder in OSS. |
/folder/test.json |
| Action |
string |
OSS operation. Valid values:
|
GetObject |
| OssRegionId |
string |
Region ID of the OSS service. |
cn-hangzhou |
| BucketName |
string |
OSS bucket name. |
cbg-db |
| EventBridgeConfig |
object |
Configuration EventBridge. |
|
| EventBus |
string |
Event bus. |
testBus |
| EventSource |
string |
Event source. |
baas_driver |
| EventBridgeRegionId |
string |
Region ID of the EventBridge service. |
cn-beijing |
| RoleArn |
string |
ARN of the RAM role that grants EventBridge permission. |
acs:ram::1933122015759***:role/adminoidcaliyun |
| OpenIdConnectConfig |
object |
Configuration OpenID Connect pour l'authentification des comptes tiers. |
|
| OpenIdApiType |
string |
Mode OpenID Connect. Valeurs valides :
|
IDTOKEN |
| IdTokenParamName |
string |
Nom du paramètre de jeton. |
xxx |
| PublicKeyId |
string |
L'identifiant de la clé publique. |
88483727556929326703309904351185815489 |
| PublicKey |
string |
Clé publique. |
EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92 |
| ErrorCodeSamples |
object |
||
| ErrorCodeSample |
array<object> |
Exemples de codes d'erreur renvoyés par le service backend. |
|
|
object |
|||
| Code |
string |
Error code. |
400 |
| Model |
string |
Model. |
[\"*\"] |
| Message |
string |
Error message. |
Missing the parameter UserId |
| Description |
string |
Description. |
Missing parameter UserId |
| SystemParameters |
object |
||
| SystemParameter |
array<object> |
Paramètres système envoyés par API Gateway au service backend. |
|
|
object |
|||
| DemoValue |
string |
Example value. |
192.168.1.1 |
| Description |
string |
Description of the parameter. |
Client IP |
| ParameterName |
string |
Name of the system parameter. Valid values: CaClientIp, CaDomain, CaRequestHandleTime, CaAppId, CaRequestId, CaHttpSchema, and CaProxy. |
CaClientIp |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
Name of the corresponding backend parameter. |
clientIp |
| CustomSystemParameters |
object |
||
| CustomSystemParameter |
array<object> |
Liste des paramètres système personnalisés. |
|
|
object |
|||
| DemoValue |
string |
Example value. |
192.168.1.1 |
| Description |
string |
Description of the parameter. |
客户端IP |
| ParameterName |
string |
Name of the system parameter. Valid values: CaClientIp, CaDomain, CaRequestHandleTime, CaAppId, CaRequestId, CaHttpSchema, and CaProxy. |
CaClientIp |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
Name of the corresponding backend parameter. |
clientIp |
| ConstantParameters |
object |
||
| ConstantParameter |
array<object> |
Paramètres constants envoyés par API Gateway au service backend. |
|
|
object |
|||
| Description |
string |
Description of the parameter. |
constance |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
Name of the backend parameter. |
constance |
| ConstantValue |
string |
Value of the constant parameter. |
constance |
| RequestParameters |
object |
||
| RequestParameter |
array<object> |
Paramètres envoyés par les consommateurs à API Gateway. |
|
|
object |
|||
| JsonScheme |
string |
JSON schema validation. Valid only when ParameterType is String. |
JSON |
| MaxValue |
integer |
Maximum value. Valid only when ParameterType is Int, Long, Float, or Double. |
123456 |
| ArrayItemsType |
string |
Type of the array element. |
String |
| MinValue |
integer |
Minimum value. Valid only when ParameterType is Int, Long, Float, or Double. |
123456 |
| DocShow |
string |
Visibility in the documentation. Valid values: PUBLIC and PRIVATE. |
PUBLIC |
| MaxLength |
integer |
Maximum length of the parameter. Valid only when ParameterType is String. |
123456 |
| DefaultValue |
string |
Default value. |
20 |
| ApiParameterName |
string |
Parameter name. |
age |
| EnumValue |
string |
Allowed discrete values. Valid only when ParameterType is Int, Long, Float, Double, or String. Separate multiple values with commas, such as 1,2,3,4,9 or A,B,C,E,F. |
boy,girl |
| DemoValue |
string |
Example value. |
20 |
| Required |
string |
Specifies whether the parameter is required. Valid values: REQUIRED and OPTIONAL. |
OPTIONAL |
| Description |
string |
Description of the parameter. |
age |
| ParameterType |
string |
Type of the parameter. Valid values: String, Int, Long, Float, Double, and Boolean. |
String |
| RegularExpression |
string |
Regular expression for parameter validation. Valid only when ParameterType is String. |
xxx |
| MinLength |
integer |
Minimum length of the parameter. Valid only when ParameterType is String. |
123456 |
| DocOrder |
integer |
Order in the documentation. |
0 |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameters |
object |
||
| ServiceParameter |
array<object> |
Paramètres que la passerelle envoie au service backend dans une requête API. |
|
|
object |
|||
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, PATH. |
HEAD |
| ParameterType |
string |
Backend parameter data type. Values can be STRING, NUMBER, or BOOLEAN, representing character, number, and Boolean respectively. |
String |
| ServiceParameterName |
string |
The name of the backend parameter. |
clientIp |
| ServiceParametersMap |
object |
||
| ServiceParameterMap |
array<object> |
Mappage entre les paramètres que le consommateur envoie à la passerelle et les paramètres que la passerelle envoie au service backend. |
|
|
object |
|||
| RequestParameterName |
string |
Corresponds to the frontend request parameter name. This value must exist in RequestParametersObject and match RequestParam.ApiParameterName. |
name |
| ServiceParameterName |
string |
Backend parameter name |
name |
| DeployedInfos |
object |
||
| DeployedInfo |
array<object> |
État de publication de l'API. |
|
|
object |
|||
| StageName |
string |
The environment name can be RELEASE or TEST. |
RELEASE |
| EffectiveVersion |
string |
The effective version. |
xxx |
| DeployedStatus |
string |
The deployment status. Valid values: DEPLOYED and NONDEPLOYED. DEPLOYED indicates that the API is deployed. NONDEPLOYED indicates that the API is not deployed. |
DEPLOYED |
| TagList |
object |
||
| Tag |
array<object> |
Liste des balises. |
|
|
object |
|||
| TagKey |
string |
Tag key |
APP |
| TagValue |
string |
Tag value |
value3 |
Exemples
JSON format
{
"ApiId": "8afff6c8c4c6447abb035812e4d66b65",
"ResultType": "JSON",
"WebSocketApiType": "COMMON",
"DisableInternet": false,
"ResultBodyModel": "{}",
"ResultSample": "200",
"AppCodeAuthType": "HEADER",
"AllowSignatureMethod": "HmacSHA256",
"RegionId": "cn-qingdao",
"ForceNonceCheck": true,
"Visibility": "PUBLIC",
"FailResultSample": "400",
"AuthType": "APP",
"ModifiedTime": "2016-07-28T13:13:12Z",
"RequestId": "D0FF585F-7966-40CF-BC60-75DB070B23D5<",
"Description": "Api description",
"GroupName": "ApiTest",
"GroupId": "08ae4aa0f95e4321849ee57f4e0b3077",
"Mock": "CLOSED",
"MockResult": "test result",
"CreatedTime": "2016-07-28T09:50:43Z",
"ApiName": "ApiName",
"BackendEnable": true,
"BackendConfig": {
"BackendId": "0038e00c3dca44fcba3a94015d8f5bbf",
"BackendType": "HTTP",
"BackendName": "testoss"
},
"RequestConfig": {
"BodyModel": "https://apigateway.aliyun.com/models/3a240a127dcc4afd9ab1bf7e947b4095/9e2df550e85b4121a79ec33e2619eaab",
"RequestPath": "/api/billing/test/[type]",
"RequestHttpMethod": "POST",
"BodyFormat": "STREAM",
"RequestMode": "MAPPING",
"PostBodyDescription": "fwefwef",
"RequestProtocol": "HTTP",
"EscapePathParam": true
},
"ServiceConfig": {
"AoneAppName": "ib-blank",
"MockStatusCode": 200,
"ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8",
"ServiceProtocol": "HTTP",
"ServicePath": "/object/add",
"ContentTypeCatagory": "CUSTOM",
"ServiceAddress": "http://api.a.com:8080",
"Mock": "TRUE",
"ServiceVpcEnable": "TRUE",
"MockResult": "test result",
"ServiceHttpMethod": "POST",
"ServiceTimeout": 1000,
"MockHeaders": {
"MockHeader": [
{
"HeaderValue": "86400",
"HeaderName": "Content-Length"
}
]
},
"VpcConfig": {
"VpcId": "vpc-2zeafsc3fygk1***",
"VpcScheme": "HTTP",
"InstanceId": "i-bp1h497hkijewv2***",
"Port": 8080,
"Name": "glmall-app-test"
},
"FunctionComputeConfig": {
"FcType": "HttpTrigger",
"RoleArn": "acs:ram::111***:role/aliyunserviceroleforsas",
"Method": "GET",
"FcBaseUrl": "https://1227****64334133.ap-southeast-1-int***al.fc.aliyuncs.com/201****-15/proxy/test****ice.LATEST/testHttp/",
"ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8",
"RegionId": "cn-qingdao",
"OnlyBusinessPath": false,
"FunctionName": "edge_function",
"ContentTypeCatagory": "DEFAULT",
"Path": "/api/offline/cacheData",
"ServiceName": "fcservicename",
"Qualifier": "2",
"TriggerName": "",
"FcVersion": ""
},
"OssConfig": {
"Key": "/folder/test.json",
"Action": "GetObject",
"OssRegionId": "cn-hangzhou",
"BucketName": "cbg-db"
},
"EventBridgeConfig": {
"EventBus": "testBus",
"EventSource": "baas_driver",
"EventBridgeRegionId": "cn-beijing",
"RoleArn": "acs:ram::1933122015759***:role/adminoidcaliyun"
}
},
"OpenIdConnectConfig": {
"OpenIdApiType": "IDTOKEN",
"IdTokenParamName": "xxx",
"PublicKeyId": "88483727556929326703309904351185815489",
"PublicKey": "EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92"
},
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "400",
"Model": "[\\\"*\\\"]",
"Message": "Missing the parameter UserId",
"Description": "Missing parameter UserId"
}
]
},
"SystemParameters": {
"SystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "Client IP",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"CustomSystemParameters": {
"CustomSystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "客户端IP",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"ConstantParameters": {
"ConstantParameter": [
{
"Description": "constance",
"Location": "HEAD",
"ServiceParameterName": "constance",
"ConstantValue": "constance"
}
]
},
"RequestParameters": {
"RequestParameter": [
{
"JsonScheme": "JSON",
"MaxValue": 123456,
"ArrayItemsType": "String",
"MinValue": 123456,
"DocShow": "PUBLIC",
"MaxLength": 123456,
"DefaultValue": "20",
"ApiParameterName": "age",
"EnumValue": "boy,girl",
"DemoValue": "20",
"Required": "OPTIONAL",
"Description": "age",
"ParameterType": "String",
"RegularExpression": "xxx",
"MinLength": 123456,
"DocOrder": 0,
"Location": "HEAD"
}
]
},
"ServiceParameters": {
"ServiceParameter": [
{
"Location": "HEAD",
"ParameterType": "String",
"ServiceParameterName": "clientIp"
}
]
},
"ServiceParametersMap": {
"ServiceParameterMap": [
{
"RequestParameterName": "name",
"ServiceParameterName": "name"
}
]
},
"DeployedInfos": {
"DeployedInfo": [
{
"StageName": "RELEASE",
"EffectiveVersion": "xxx",
"DeployedStatus": "DEPLOYED"
}
]
},
"TagList": {
"Tag": [
{
"TagKey": "APP",
"TagValue": "value3"
}
]
}
}
Codes d'erreur
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.