Serverless工作流采用RPC风格API,支持GET和POST请求方式。本文提供了调用Serverless工作流API的方法,一次API请求中,会涉及签名、参数设定以及身份验证等设置。

请求结构

此章节讲解HTTP/HTTPS调用场景中,一次API的请求的结构分析。

以下是GET请求的URL格式,字符编码采用UTF-8规范。

http(s)://Endpoint/?Action=xx&Parameters
  • Endpoint:调用的云服务的接入点。
  • Action:当前请求需要执行的操作,例如使用StartExecution执行一个流程。
  • Parameters:代指请求参数,由公共请求参数和API自定义参数组成,参数之间使用“&”分隔。

以下是StartExecution接口的请求示例:

https://[Endpoint]/?Action=StartExecution
&FlowName=Flow
&公共请求参数
说明 为了获得更高的安全性,建议您使用HTTPS协议发送API请求。

接入地址

Serverless工作流API的服务接入地址为:XXX.aliyuncs.com。

网络类型 地域 服务接入地址
公网服务 华东1(杭州) {account-id}.cn-hangzhou.fnf.aliyuncs.com
华东2(上海) {account-id}.cn-shanghai.fnf.aliyuncs.com
华北2(北京) {account-id}.cn-beijing.fnf.aliyuncs.com
华南1(深圳) {account-id}.cn-shenzhen.fnf.aliyuncs.com
美国(硅谷) {account-id}.us-west-1.fnf.aliyuncs.com
新加坡 {account-id}.ap-southeast-1.fnf.aliyuncs.com
内网服务 华东1(杭州) {account-id}.cn-hangzhou-internal.fnf.aliyuncs.com
华东2(上海) {account-id}.cn-shanghai-internal.fnf.aliyuncs.com
华北2(北京) {account-id}.cn-beijing-internal.fnf.aliyuncs.com
华南1(深圳) {account-id}.cn-shenzhen-internal.fnf.aliyuncs.com
美国(硅谷) {account-id}.us-west-1-internal.fnf.aliyuncs.com
新加坡 {account-id}.ap-southeast-1-internal.fnf.aliyuncs.com
说明 表格中的{account-id}需要修改为您的账号ID,您可以在控制台单击右上角头像,查看企业别名即是您的账号ID。

公共参数

以下公共请求参数适用于通过URL发送GET请求调用Serverless工作流API。

名称 类型 是否必选 示例值 描述
Action String StartExecution API的名称。
AccessKeyId String LTAIp4********fjx 访问密钥ID。更多详情,请参见创建AccessKey
Signature String OLeaidS1JvxuMvnyHOwuJ%2BuX5qY%3D 您的签名。
SignatureMethod String HMAC-SHA1 签名方式。默认签名方式:HMAC-SHA1。
SignatureVersion String 1.0 签名算法版本。默认版本:1.0。
SignatureNonce String 3ee8c1b8-****-44af-****-4e0ad82fd6cf 签名唯一随机数。用于防止网络重放攻击,建议您每一次请求都使用不同的随机数。
Timestamp String 2018-01-01T12:00:00Z 请求的时间戳。按照ISO8601标准表示,并使用UTC+0时间,格式为yyyy-MM-ddTHH:mm:ssZ。
Version String 2019-03-15 API的版本号,格式为YYYY-MM-DD。默认API的版本号:2019-03-15。
Format String json 返回参数的语言类型。语言类型为json或xml格式。默认的语言类型:json。