Generate documentation and SDK

Last updated: 2020-02-21 15:27:30

Interface description

This API (GenerateApiDocument) is used to automatically generate API Documentation and SDK, a service environment to generate a document and SDK.

Input Parameter

The following request parameter list only lists the API request parameters. For other parameters, please see Common Request Parameters .

Parameter name Required Type Description
ServiceId Yes String Unique ID of the service for which the document is to be created
Language Yes String The language in which the SDK is to be created. Currently, only Python and JavaScript are supported.
Environment Yes String The environment of the service to be created for SDK

Output Parameter

Parameter name Type Description
Code Int Common error code, 0 indicates success, other values indicate failure. For more information, please see the error code page Common error code
CodeDesc String Error code on the business side. Return the specific cause of the business error when a Success, error is returned on success.
DocumentURL String The generated document is stored in COS, and this output parameter returns the download link of the generated file.
SdkURL String The generated SDK is stored in COS, and this output parameter returns the download link of the generated SDK file.

Example

https://apigateway.api.qcloud.com/v2/index.php?
&<Common request parameters>
&Action=GenerateApiDocument
&serviceId=service-xxxx
&language=python
&environment=release

The returned results are as below:

{
    "code": "0",
    "message": "",
    "codeDesc": "Success",
    "documentURL": "http://api-document-1253970226.cosgz.myqcloud.com/service-xxxx.zip",
    "sdkURL": "http://api-sdk-python-1253970226.cosgz.myqcloud.com/service-xxxx.zip"
}