閱讀187 返回首頁    go 財經資訊


查詢API服務文檔__API管理相關接口_API_API 網關-阿裏雲

描述

查詢指定API的服務說明文檔。

  • 此功能麵向調用API的用戶,指定的API必須是發布到運行環境,且Visibility=PUBLIC的API或者被授權的Visibility=PRIVATE的API
  • 若您是調用API的用戶,該接口返回您指定的API的服務信息及參數定義等詳情信息。
  • 若您是開放API的用戶,那麼調用該接口可以查看當前指定API在指定環境中運行的定義,可能與您現在修改中的API定義不同,是真正在環境中生效的定義。
  • 若您是開放API的用戶,由於該接口麵向API調用者鑒權,所以您需要確認該API為PUBLIC類型或者您的相關APP已被授權。

請求參數

名稱 類型 是否必須 描述
Action String 操作接口名,係統規定參數,取值:DescribeApiDoc
GroupId String 指定的分組編號
ApiId String 指定的API編號
StageName String 環境名稱,可選值:
  • RELEASE: 線上
  • TEST: 測試
若不傳入,則默認為release。

返回參數

名稱 類型 描述
RequestId String 本次請求編號
RegionId String 所在的region
GroupId String API分組編號
GroupName String API分組名稱
StageName String 環境名稱,可選值:
  • RELEASE: 線上
  • TEST: 測試
ApiId String API編號
ApiName String API名稱
Description String API描述
Visibility String 可見性,取值為:PUBLIC、PRIVATE,分別表示公開、私有
AuthType String 安全認證方式,取值為:APP、ANONYMOUS,分別表示阿裏雲APP、匿名
ResultType String 返回類型
ResultSample String 返回示例
FailResultSample String 後端服務失敗返回應答的示例
ErrorCodeSamples ErrorCodeSample 後端服務返回的錯誤碼示例,詳情見ApiAttributesType.md#ErrorCodeSamples
RequestConfig RequestConfig 由 RequestConfig 組成的格式,返回API前端定義信息
RequestParameters RequestParameter 由 RequestParameter 組成的數組格式,返回API中前端入參信息項

示例

請求示例

  1. https://apigateway.cn-qingdao.aliyuncs.com/?Action=DescribeApiDoc
  2. &GroupId=0009db9c828549768a200320714b8930
  3. &ApiId=3b81fd160f5645e097cc8855d75a1cf6
  4. &<公共請求參數>

返回示例

XML格式

  1. <DescribeApiDocResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BZ014</RequestId>
  3. <RegionId>cn-qingdao</RegionId>
  4. <GroupId>0009db9c828549768a200320714b8930</GroupId>
  5. <GroupName>myGroup2</GroupName>
  6. <StageName>RELEASE</StageName>
  7. <ApiId>3b81fd160f5645e097cc8855d75a1cf6</ApiId>
  8. <ApiName>creatobject</ApiName>
  9. <Description>對象創建</Description>
  10. <Visibility>public</Visibility>
  11. <AuthType>APP</AuthType>
  12. <ResultType>application/json</ResultType>
  13. <ResultSample></ResultSample>
  14. <FailResultSample></FailResultSample>
  15. <ErrorCodeSamples>
  16. <ErrorCodeSample>
  17. <Code>400</Code>
  18. <Message>Missing the parameter UserId</Message>
  19. <Description>請求缺少參數 UserId</Description>
  20. </ErrorCodeSample>
  21. </ErrorCodeSamples>
  22. <RequestConfig>
  23. <RequestProtocol>HTTP</RequestProtocol>
  24. <RequestHttpMethod>GET</RequestHttpMethod>
  25. <RequestPath>/mypath/creatobject</RequestPath>
  26. <BodyFormat>FORM</BodyFormat>
  27. <PostBodyDescription>對象</PostBodyDescription>
  28. </RequestConfig>
  29. <RequestParameters>
  30. <RequestParameter>
  31. <ApiParameterName>RequestKey1</ApiParameterName>
  32. <Location>QUERY</Location>
  33. <ParameterType>String</ParameterType>
  34. <Required>REQUIRED</Required>
  35. <DefaultValue></DefaultValue>
  36. <DemoValue>demo1</DemoValue>
  37. <MaxValue></MaxValue>
  38. <MinValue></MinValue>
  39. <MaxLength>100</MaxLength>
  40. <MinLength>3</MinLength>
  41. <RegularExpression></RegularExpression>
  42. <JsonScheme></JsonScheme>
  43. <EnumValue></EnumValue>
  44. <DocShow>PUBLIC</DocShow>
  45. <DocOrder>1</DocOrder>
  46. <Description>Desc1</Description>
  47. </RequestParameter>
  48. <RequestParameter>
  49. <ApiParameterName>RequestKey2</ApiParameterName>
  50. <Location>QUERY</Location>
  51. <ParameterType>Number</ParameterType>
  52. <Required>OPTIONAL</Required>
  53. <DefaultValue></DefaultValue>
  54. <DemoValue>12</DemoValue>
  55. <MaxValue>120</MaxValue>
  56. <MinValue>100</MinValue>
  57. <MaxLength></MaxLength>
  58. <MinLength></MinLength>
  59. <RegularExpression></RegularExpression>
  60. <JsonScheme></JsonScheme>
  61. <EnumValue></EnumValue>
  62. <DocShow>PUBLIC</DocShow>
  63. <DocOrder>2</DocOrder>
  64. <Description>Desc2</Description>
  65. </RequestParameter>
  66. </RequestParameters>
  67. </DescribeApiDocResponse>

JSON格式

  1. {
  2. "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BZ014",
  3. "RegionId": "cn-qingdao",
  4. "GroupId": "0009db9c828549768a200320714b8930",
  5. "GroupName": "myGroup2",
  6. "StageName": "RELEASE",
  7. "ApiId": "3b81fd160f5645e097cc8855d75a1cf6",
  8. "ApiName": "creatobject",
  9. "Description": "對象創建",
  10. "Visibility": "public",
  11. "AuthType": "APP",
  12. "ResultType": "application/json",
  13. "ResultSample": "200",
  14. "FailResultSample": "400",
  15. "ErrorCodeSamples": {
  16. "ErrorCodeSample": [
  17. {
  18. "Code": "400",
  19. "Message": "Missing the parameter UserId",
  20. "Description": "請求缺少參數 UserId"
  21. }
  22. ]
  23. },
  24. "RequestConfig": {
  25. "RequestProtocol": "HTTP",
  26. "RequestHttpMethod": "GET",
  27. "RequestPath": "/mypath/creatobject",
  28. "BodyFormat": "FORM",
  29. "PostBodyDescription": "對象"
  30. },
  31. "RequestParameters": {
  32. "RequestParameter": [
  33. {
  34. "ApiParameterName": "RequestKey1",
  35. "Location": "QUERY",
  36. "ParameterType": "String",
  37. "Required": "REQUIRED",
  38. "DemoValue": "demo1",
  39. "MaxLength": "100",
  40. "MinLength": "3",
  41. "DocShow": "PUBLIC",
  42. "DocOrder": "1",
  43. "Description": "Desc1"
  44. },
  45. {
  46. "ApiParameterName": "RequestKey2",
  47. "Location": "QUERY",
  48. "ParameterType": "Number",
  49. "Required": "OPTIONAL",
  50. "DemoValue": "12",
  51. "MaxValue": "120",
  52. "MinValue": "100",
  53. "DocShow": "PUBLIC",
  54. "DocOrder": "2",
  55. "Description": "Desc2"
  56. }
  57. ]
  58. }
  59. }

最後更新:2016-11-23 17:16:09

  上一篇:go 查詢API詳情__API管理相關接口_API_API 網關-阿裏雲
  下一篇:go 查詢API列表__API管理相關接口_API_API 網關-阿裏雲