ApplyCertificate - 申请免费证书

申请免费证书。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
esa:ApplyCertificatecreate
*Site
acs:esa:{#regionId}:{#accountId}:site/{#SiteId}

请求参数

名称类型必填描述示例值
SiteIdlong

站点 ID。

1234567890123
Domainsstring

域名列表,多个域名用逗号分隔。

www.example.com,blog.example.com
Typestring

证书类型。可能值:lets_encrypt:Let's Encrypt 证书;digicert_single:Digicert 单域名证书;digicert_wildcard:Digicert 泛域名证书。

lets_encrypt

返回参数

名称类型描述示例值
object

Schema of Response

SiteNamestring

站点名称。

example.com
TotalCountlong

申请的证书个数,和输入的域名个数相同。

2
Resultarray<object>

免费证书申请详情列表。

Resultobject

免费证书申请详情。

Domainstring

证书域名。

*.example.com
Statusstring

证书申请状态。

Applying
Idstring

证书 Id。

30000478
RequestIdstring

请求 ID。

156A6B-677B1A-4297B7-9187B7-2B44792

示例

正常返回示例

JSON格式

{
  "SiteName": "example.com ",
  "TotalCount": 2,
  "Result": [
    {
      "Domain": "*.example.com ",
      "Status": "Applying",
      "Id": "30000478"
    }
  ],
  "RequestId": "156A6B-677B1A-4297B7-9187B7-2B44792"
}

错误码

HTTP status code错误码错误信息描述
400SiteNotFoundThe specified site is not found.您指定的站点不存在,请检查输入的站点是否正确。
400SiteNotActivatedThe site is not activated, the process is not allowed.站点未激活,不支持该操作。
400MissingSiteIdRequired parameter SiteId missing. Specify SiteId and try again.缺少必填参数SiteId,请指定SiteId参数后重试。
400InvalidParameter.DomainsYou have already submitted a certificate application for the domain name.您已提交该域名证书申请任务,请勿重复提交。
400InternalExceptionFailed to call the service. Try again later or contact technical support.调用服务失败,请稍后重试或联系客服咨询详情。
400InvalidParameter.DomainsThe maximum number of domain names specified by parameter Domains has been reached. Adjust your configurations and try again. The upper limit of lets.encrypt type domain name is 50, the upper limit of digicert.single type domain name is 10, and the upper limit of digicert.wildcard type domain name is 1.Domains参数中包含的域名数超过配额,请重新指定后重试。lets_encrypt类型域名上限为50,digicert_single类型域名上限为10,digicert_wildcard类型域名上限为1。
400InvalidParameter.DomainsThe domain specified in Domains parameter is not a valid domain name, please check and try again.Domains参数中存在无效的域名,请检查后重试。
400InvalidParameter.DomainsOne or more domain names specified by parameter Domains do not belong to the current website. Check and try again.指定参数Domains中包含的域名存在不属于当前站点的情况,请检查后重试。
400QuotaCheckFailedFailed to check free certificate Quota, please try again later.检查免费证书Quota失败,请稍后重试。
400InvalidParameter.TypeThe specified Type parameter is invalid, please check and try again.您配置的Type参数有误,请您检查后重试。证书申请Type支持lets_encrypt,digicert_single,digicert_wildcard。
400QuotaExceed.RecordCountThe maximum number of records has been reached. Delete some and try again or upgrade your plan.记录数量已达上限,请删除部分记录后重试或升级套餐。
400InvalidParameter.DomainsThe site which is configured in CNAME mode does not support wildcard domain certificate application.CNAME站点不支持申请泛域名免费证书。
403Unauthorized.InvalidTimeThe specified authentication time is invalid.您输入的鉴权时间参数无效,请检查参数值后重试。
403Unauthorized.InvalidTokenToken authentication failed.您输入的token无效,请检查并输入正确的token后进行重试。
403QuotaExceededThe quota is exceeded.额度不足

访问错误中心查看更多错误码。