Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
DataArts Fabric
IoT
IoT Device Access
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance (CCI)
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating an API

Function

This API is used to create an API. An API is an interface that encapsulates a set of service capabilities. The definition of an API is divided into two parts: how the API is called by users, and how ROMA Connect accesses the actual backend service requested by users. Three backend types are supported: HTTP/HTTPS web, FunctionGraph, and Mock.

URI

POST /v1/{project_id}/apic/instances/{instance_id}/apis

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Appendix > Obtaining a Project ID in the ROMA Connect API Reference.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

API name.

The value can contain only letters, digits, hyphens (-), underscores (_), periods (.), slashes (/), parentheses, and colons (:). The value must start with a letter or digit.

type

Yes

Integer

API type.

  • 1: public

  • 2: private

version

No

String

API version.

req_protocol

Yes

String

API request protocol.

  • HTTP

  • HTTPS

  • BOTH: Both HTTP and HTTPS are supported.

req_method

Yes

String

API request method.

req_uri

Yes

String

Request URI. The value can contain request parameters identified by braces ({}), for example, /getUserInfo/{userId}. Special characters such as * / / %- _ . are supported. The total length cannot exceed 512 characters and must meet the URI specifications.

NOTE:

The request address must comply with URI specifications.

auth_type

Yes

String

API authentication mode. The options are as follows:

  • NONE

  • APP

  • IAM

  • AUTHORIZER (custom)

auth_opt

No

AuthOpt object

Security authentication parameter.

cors

No

Boolean

Whether CORS is supported.

  • TRUE: supported

  • FALSE: not supported

match_mode

No

String

Match mode of an API.

  • SWA: prefix match

  • NORMAL: exact match (default)

    The default value is NORMAL.

backend_type

Yes

String

Backend type.

  • HTTP: web backend

  • FUNCTION: FunctionGraph backend

  • MOCK: Mock backend

remark

No

String

Description of the API, which cannot contain < and >.

group_id

Yes

String

ID of the API group to which the API belongs.

body_remark

No

String

API request body, which can be an example request body, media type, or parameters.

result_normal_sample

No

String

Example response for a successful request.

result_failure_sample

No

String

Example response for a failed request.

authorizer_id

No

String

ID of the frontend custom authorizer.

tags

No

Array of strings

Tags.

The value can contain only letters, digits, and underscores (_), and must start with a letter. You can enter multiple tags and separate them with commas (,).

response_id

No

String

Group response ID.

This parameter is currently not supported.

roma_app_id

No

String

ID of the integration application to which an API belongs.

This parameter is mandatory when the API group is a global group or when an API is bound to a user-defined domain name.

domain_name

No

String

User-defined domain name bound to the API. If a user-defined domain name is used, the roma_app_id field is mandatory.

tag

No

String

Tag.

This field will be deprecated. You can use the tags field instead.

mock_info

No

ApiMockCreate object

Mock backend details.

func_info

No

ApiFuncCreate object

FunctionGraph backend details.

req_params

No

Array of ReqParamBase objects

Request parameters.

backend_params

No

Array of BackendParamBase objects

Backend parameters.

policy_mocks

No

Array of ApiPolicyMockCreate objects

Mock policy backend information.

policy_functions

No

Array of ApiPolicyFunctionCreate objects

FunctionGraph policy backend information.

backend_api

No

BackendApiCreateV1 object

Web backend details

policy_https

No

Array of ApiPolicyHttpCreateV1 objects

Web policy backends.

Table 4 AuthOpt

Parameter

Mandatory

Type

Description

app_code_auth_type

No

String

Indicates whether AppCode authentication is enabled. This parameter is valid only if auth_type is set to App. The default value is DISABLE.

  • DISABLE: AppCode authentication is disabled.

  • HEADER: AppCode authentication is enabled and the AppCode is located in the header.

Table 5 ApiMockCreate

Parameter

Mandatory

Type

Description

remark

No

String

Description.

result_content

No

String

Response.

version

No

String

Version. Ensure that the version does not exceed 64 characters.

authorizer_id

No

String

Backend custom authorizer ID.

status_code

No

Integer

Customized status code of the mock backend:

"200": "OK",

"201": "Created",

"202": "Accepted",

"203": "NonAuthoritativeInformation",

"204": "NoContent",

"205": "ResetContent",

"206": "PartialContent",

"300": "MultipleChoices",

"301": "MovedPermanently",

"302": "Found",

"303": "SeeOther",

"304": "NotModified",

"305": "UseProxy",

"306": "Unused",

"307": "TemporaryRedirect",

"400": "BadRequest",

"401": "Unauthorized",

"402": "PaymentRequired",

"403": "Forbidden",

"404": "NotFound",

"405": "MethodNotAllowed",

"406": "NotAcceptable",

"407": "ProxyAuthenticationRequired",

"408": "RequestTimeout",

"409": "Conflict",

"410": "Gone",

"411": "LengthRequired",

"412": "PreconditionFailed",

"413": "RequestEntityTooLarge",

"414": "RequestURITooLong",

"415": "UnsupportedMediaType",

"416": "RequestedRangeNotSatisfiable",

"417": "ExpectationFailed",

"450": "ParameterRequried",

"451": "MethodConnectException",

"500": "InternalServerError",

"501": "NotImplemented",

"502": "BadGateway",

"503": "ServiceUnavailable",

"504": "GatewayTimeout",

"505": "HTTPVersionNotSupported"

header

No

String

Custom response header of the mock backend.

Format: [{"key":"","value": "", "remark:""}, {"key2":"","value2": "","remark2:""}]

Description:

key: key of the mock backend's custom response header. It must start with a letter or digit, and can include only letters, digits, and hyphens (-) (max. 64 characters).

value: value of the mock backend's custom response header. This parameter cannot be empty (max. 10,240 characters).

remark: remark of the mock backend's custom response header. This parameter can be empty (max. 2048 characters).

Table 6 ApiFuncCreate

Parameter

Mandatory

Type

Description

function_urn

Yes

String

Function URN.

network_type

No

String

Network architecture type of the function. Options:

  • V1: non-VPC

  • V2: VPC

remark

No

String

Description.

invocation_type

Yes

String

Invocation mode.

  • async: asynchronous

  • sync: synchronous

version

No

String

Version of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

alias_urn

No

String

Alias URN of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

timeout

Yes

Integer

Timeout allowed for APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

authorizer_id

No

String

Backend custom authorizer ID.

Table 7 ReqParamBase

Parameter

Mandatory

Type

Description

name

Yes

String

Parameter name.

The value can contain letters, digits, hyphens (-), underscores (_), and periods (.) and must start with a letter.

type

Yes

String

Parameter type.

location

Yes

String

Parameter location.

default_value

No

String

Default value.

sample_value

No

String

Example value.

required

No

Integer

Indicates whether the parameter is mandatory.

  • 1: The parameter is mandatory.

  • 2: The parameter is optional.

The value of this parameter is 1 if Location is set to PATH, and 2 if Location is set to another value.

valid_enable

No

Integer

Indicates whether validity check is enabled.

  • 1: enabled

  • 2: disabled

remark

No

String

Description.

enumerations

No

String

Enumerated value.

min_num

No

Integer

Minimum value.

This parameter is valid when type is set to NUMBER.

max_num

No

Integer

Maximum value.

This parameter is valid when type is set to NUMBER.

min_size

No

Integer

Minimum length.

This parameter is valid when type is set to STRING.

max_size

No

Integer

Maximum length.

This parameter is valid when type is set to STRING.

regular

No

String

Regular expression validation rule.

This parameter is currently not supported.

json_schema

No

String

JSON validation rule.

This parameter is currently not supported.

pass_through

No

Integer

Indicates whether to transparently transmit the parameter.

  • 1: The parameter is transparently transmitted.

  • 2: The parameter is not transparently transmitted.

orchestrations

No

Array of strings

Request parameter orchestration rules.

Request parameter orchestration rules are prioritized in the same sequence as the list.

The none_value rule in a rule list has the highest priority. A maximum of one none_value rule can be bound.

The default rule in a rule list has the lowest priority. A maximum of one default rule can be bound.

The preprocessing orchestration rule cannot be used as the last orchestration rule except the default rule.

Only one parameter of each API can be bound with unique orchestration rules. The number of orchestration rules that can be bound is limited by quota. For details, see "Quotas" in ROMA Connect Service Overview.

Table 8 ApiPolicyMockCreate

Parameter

Mandatory

Type

Description

result_content

No

String

Response.

status_code

No

Integer

Customized status code of the mock backend:

"200": "OK",

"201": "Created",

"202": "Accepted",

"203": "NonAuthoritativeInformation",

"204": "NoContent",

"205": "ResetContent",

"206": "PartialContent",

"300": "MultipleChoices",

"301": "MovedPermanently",

"302": "Found",

"303": "SeeOther",

"304": "NotModified",

"305": "UseProxy",

"306": "Unused",

"307": "TemporaryRedirect",

"400": "BadRequest",

"401": "Unauthorized",

"402": "PaymentRequired",

"403": "Forbidden",

"404": "NotFound",

"405": "MethodNotAllowed",

"406": "NotAcceptable",

"407": "ProxyAuthenticationRequired",

"408": "RequestTimeout",

"409": "Conflict",

"410": "Gone",

"411": "LengthRequired",

"412": "PreconditionFailed",

"413": "RequestEntityTooLarge",

"414": "RequestURITooLong",

"415": "UnsupportedMediaType",

"416": "RequestedRangeNotSatisfiable",

"417": "ExpectationFailed",

"450": "ParameterRequried",

"451": "MethodConnectException",

"500": "InternalServerError",

"501": "NotImplemented",

"502": "BadGateway",

"503": "ServiceUnavailable",

"504": "GatewayTimeout",

"505": "HTTPVersionNotSupported"

header

No

String

Custom response header of the mock backend.

Format: [{"key":"","value": "", "remark:""}, {"key2":"","value2": "","remark2:""}]

Description:

key: key of the mock backend's custom response header. It must start with a letter or digit, and can include only letters, digits, and hyphens (-) (max. 64 characters).

value: value of the mock backend's custom response header. This parameter cannot be empty (max. 10,240 characters).

remark: remark of the mock backend's custom response header. This parameter can be empty (max. 2048 characters).

effect_mode

Yes

String

Effective mode of the backend policy.

  • ALL: All conditions are met.

  • ANY: Any condition is met.

name

Yes

String

Backend name, which must start with a letter and can contain letters, digits, hyphens (-), and underscores (_).

backend_params

No

Array of BackendParamBase objects

Backend parameters. This is unavailable for the GRPC backend.

conditions

Yes

Array of ApiConditionCreate objects

Policy conditions

authorizer_id

No

String

Backend custom authorizer ID.

Table 9 ApiPolicyFunctionCreate

Parameter

Mandatory

Type

Description

function_urn

Yes

String

Function URN.

network_type

No

String

Network architecture type of the function. Options:

  • V1: non-VPC

  • V2: VPC

invocation_type

Yes

String

Invocation mode.

  • async: asynchronous

  • sync: synchronous

timeout

Yes

Integer

Timeout allowed for APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

version

No

String

Version of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

alias_urn

No

String

Alias URN of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

effect_mode

Yes

String

Effective mode of the backend policy.

  • ALL: All conditions are met.

  • ANY: Any condition is met.

name

Yes

String

Backend name, which must start with a letter and can contain letters, digits, hyphens (-), and underscores (_).

backend_params

No

Array of BackendParamBase objects

Backend parameters. This is unavailable for the GRPC backend.

conditions

Yes

Array of ApiConditionCreate objects

Policy conditions

authorizer_id

No

String

Backend custom authorizer ID.

Table 10 BackendParamBase

Parameter

Mandatory

Type

Description

name

Yes

String

Parameter name,

which must start with a letter and can only contain letters, digits, hyphens (-), underscores (_), and periods (.).

location

Yes

String

Parameter location. The value can be PATH, QUERY, or HEADER.

origin

Yes

String

Parameter type. The value can be REQUEST, CONSTANT, and SYSTEM.

value

Yes

String

Parameter value, with a maximum of 255 characters.

If the origin type is REQUEST, the value of this parameter is the parameter name in req_params.

If the origin type is CONSTANT, the value is a constant.

If the origin type is SYSTEM, the value is a system parameter name. System parameters include gateway parameters, frontend authentication parameters, and backend authentication parameters. You can set the frontend or backend authentication parameters after enabling custom frontend or backend authentication.

The gateway parameters are as follows:

  • $context.sourceIp: source IP address of the API caller

  • $context.stage: deployment environment in which the API is called

  • $context.apiName: API name

  • $context.apiId: API ID

  • $context.appName: name of the app used by the API caller

  • $context.appId: ID of the app used by the API caller

  • $context.requestId: request ID generated when the API is called

  • $context.serverAddr: address of the gateway server

  • $context.serverName: name of the gateway server

  • $context.handleTime: processing time of the API request

  • $context.providerAppId: ID of the app used by the API owner (not supported)

  • $context.clientCertCN: client certificate CN carried in the API invoking when client authentication is enabled

Frontend authentication parameter: prefixed with "$context.authorizer.frontend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.frontend.aaa".

Backend authentication parameter: prefixed with "$context.authorizer.backend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.backend.aaa".

remark

No

String

Description.

Table 11 ApiConditionCreate

Parameter

Mandatory

Type

Description

req_param_name

No

String

Input parameter name. This parameter is required if the policy type is param.

sys_param_name

No

String

System parameter name. This parameter is mandatory when the policy type is set to system. The following system parameters are supported:

  • req_path: request path, such as /a/b

  • req_method: request method, such as GET

cookie_param_name

No

String

COOKIE parameter name. This parameter is required if the policy type is cookie.

frontend_authorizer_param_name

No

String

Frontend authorizer parameter name (system parameter). This parameter is required if the policy type is frontend_authorizer. The frontend authentication parameter name is prefixed with $context.authorizer.frontend. For example, if the frontend authentication parameter name is user_name, add the prefix and the value is $context.authorizer.frontend.user_name.

condition_type

No

String

Policy condition.

  • exact: Exact match.

  • enum: Enumeration.

  • pattern: Regular expression.

This parameter is mandatory when the policy type is param, cookie, or frontend_authorizer.

condition_origin

Yes

String

Policy type

  • param: Parameter.

  • source: Source IP.

  • system: Built-in gateway parameter (system parameter).

  • cookie: COOKIE parameter.

  • frontend_authorizer: Frontend authorizer parameter (system parameter).

  • orchestration: Parameter orchestration rule.

condition_value

Yes

String

Policy value, which is required when the policy type is param, source, cookie, or frontend_authorizer.

mapped_param_name

No

String

Name of a parameter generated after orchestration. This parameter is mandatory when condition_origin is set to orchestration. The generated parameter name must exist in the orchestration rule bound to the API.

mapped_param_location

No

String

Location of a parameter generated after orchestration. This parameter is mandatory when condition_origin is set to orchestration. This location must exist in the orchestration rule bound to the API.

Table 12 BackendApiCreateV1

Parameter

Mandatory

Type

Description

authorizer_id

No

String

Backend custom authorizer ID.

url_domain

No

String

Address of the backend service.

The value consists of the host (IP address or domain name) and port number. The total length cannot exceed 255 characters. The format is Host name:Port number (for example, apig.example.com:7443). If the port number is not specified, the default HTTPS port number is 443, and the default HTTP port number is 80.

Environment variables are supported. If environment variables are used, each variable name is a string of 3 to 32 characters. The string consists of letters, digits, underscores (_), and hyphens (-), and must start with an English letter.

req_protocol

Yes

String

Request protocol.

remark

No

String

Description.

req_method

Yes

String

Request method.

version

No

String

Web backend version, which can contain a maximum of 16 characters.

req_uri

Yes

String

Request URI. The value can contain request parameters identified by braces ({}), for example, /getUserInfo/{userId}. Special characters such as * / / %- _ . are supported. The total length cannot exceed 512 characters and must meet the URI specifications.

Environment variables are supported. If environment variables are used, each variable name is a string of 3 to 32 characters. The string consists of letters, digits, hyphens (-), and underscores (_) and must start with an English letter.

NOTE:

The value must comply with the URI specifications.

timeout

Yes

Integer

Timeout allowed for ROMA Connect APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

enable_client_ssl

No

Boolean

Whether to enable two-way authentication.

vpc_info

No

VpcInfoV1 object

VPC channel information.

vpc_status

No

Integer

Whether to use a VPC channel:

  • 1: yes

  • 2: no

Table 13 ApiPolicyHttpCreateV1

Parameter

Mandatory

Type

Description

url_domain

No

String

Endpoint of the policy backend. The value consists of a domain name (or an IP address) and a port number. The total length cannot exceed 255 characters. The value is in Domain name:Port number format, for example, apig.example.com:7443. If the port number is not specified, the default HTTPS port number is 443 and the default HTTP port number is 80.Environment variables are supported. If environment variables are used, each variable name must contain 3 to 32 characters, including letters, digits, underscores (_), and hyphens (-). The value must start with a letter.

req_protocol

Yes

String

Request protocol. The value can be HTTP or HTTPS.

req_method

Yes

String

Request method. The value can be GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS or ANY.

req_uri

Yes

String

Request URI. The value can contain request parameters identified by braces ({}), for example, /getUserInfo/{userId}. Special characters such as * / / %- _ . are supported. The total length cannot exceed 512 characters and must meet the URI specifications.

Environment variables are supported. If environment variables are used, each variable name is a string of 3 to 32 characters. The string consists of letters, digits, hyphens (-), and underscores (_) and must start with an English letter.

NOTE:

The value must comply with the URI specifications.

timeout

No

Integer

Timeout allowed for ROMA Connect APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

enable_client_ssl

No

Boolean

Whether to enable two-way authentication.

effect_mode

Yes

String

Effective mode of the backend policy.

  • ALL: All conditions are met.

  • ANY: Any condition is met.

name

Yes

String

Backend name, which must start with a letter and can contain letters, digits, and underscores (_).

backend_params

No

Array of BackendParamBase objects

Backend parameters

conditions

Yes

Array of ApiConditionCreate objects

Policy conditions

authorizer_id

No

String

Backend custom authorizer ID.

vpc_info

No

VpcInfoV1 object

VPC channel information.

vpc_status

No

Integer

Whether to use a VPC channel:

  • 1: yes

  • 2: no

Table 14 VpcInfoV1

Parameter

Mandatory

Type

Description

ecs_id

No

String

Cloud server ID.

ecs_name

No

Integer

Cloud server name.

cascade_flag

No

Boolean

Indicates whether to use the cascading mode.

This parameter is currently not supported.

vpc_proxy_host

No

String

Proxy host.

vpc_id

No

String

VPC channel ID.

vpc_port

No

String

VPC channel port.

Response Parameters

Status code: 201

Table 15 Response body parameters

Parameter

Type

Description

name

String

API name.

The value can contain only letters, digits, hyphens (-), underscores (_), periods (.), slashes (/), parentheses, and colons (:). The value must start with a letter or digit.

type

Integer

API type.

  • 1: public

  • 2: private

version

String

API version.

req_protocol

String

API request protocol.

  • HTTP

  • HTTPS

  • BOTH: Both HTTP and HTTPS are supported.

req_method

String

API request method.

req_uri

String

Request URI. The value can contain request parameters identified by braces ({}), for example, /getUserInfo/{userId}. Special characters such as * / / %- _ . are supported. The total length cannot exceed 512 characters and must meet the URI specifications.

NOTE:

The request address must comply with URI specifications.

auth_type

String

API authentication mode. The options are as follows:

  • NONE

  • APP

  • IAM

  • AUTHORIZER (custom)

auth_opt

AuthOpt object

Security authentication parameter.

cors

Boolean

Whether CORS is supported.

  • TRUE: supported

  • FALSE: not supported

match_mode

String

Match mode of an API.

  • SWA: prefix match

  • NORMAL: exact match (default)

    The default value is NORMAL.

backend_type

String

Backend type.

  • HTTP: web backend

  • FUNCTION: FunctionGraph backend

  • MOCK: Mock backend

remark

String

Description of the API, which cannot contain < and >.

group_id

String

ID of the API group to which the API belongs.

body_remark

String

API request body, which can be an example request body, media type, or parameters.

result_normal_sample

String

Example response for a successful request.

result_failure_sample

String

Example response for a failed request.

authorizer_id

String

ID of the frontend custom authorizer.

tags

Array of strings

Tags.

The value can contain only letters, digits, and underscores (_), and must start with a letter. You can enter multiple tags and separate them with commas (,).

response_id

String

Group response ID.

This parameter is currently not supported.

roma_app_id

String

ID of the integration application to which an API belongs.

This parameter is mandatory when the API group is a global group or when an API is bound to a user-defined domain name.

domain_name

String

User-defined domain name bound to the API. If a user-defined domain name is used, the roma_app_id field is mandatory.

tag

String

Tag.

This field will be deprecated. You can use the tags field instead.

id

String

API ID.

status

Integer

API status:

  • 1: Valid

arrange_necessary

Integer

Whether to enable orchestration.

register_time

String

Time when the API is registered.

update_time

String

Time when the API was last modified.

group_name

String

Name of the API group to which the API belongs.

group_version

String

Version of the API group to which the API belongs.

run_env_name

String

Name of the environment in which the API has been published.

Separate multiple environment names with vertical bars (|).

run_env_id

String

ID of the environment in which the API has been published.

Separate multiple environment IDs with vertical bars (|).

publish_id

String

Publication record ID.

Separate multiple publication record IDs with vertical bars (|).

roma_app_name

String

Name of the integration application to which the API belongs.

ld_api_id

String

ID of the corresponding custom backend API.

func_info

ApiFunc object

FunctionGraph backend details.

mock_info

ApiMock object

Mock backend details.

req_params

Array of ReqParam objects

Request parameters.

backend_params

Array of BackendParam objects

Backend parameters.

policy_functions

Array of ApiPolicyFunctionResp objects

FunctionGraph policy backend information.

policy_mocks

Array of ApiPolicyMockResp objects

Mock policy backend information.

backend_api

BackendApiV1 object

Web backend details

policy_https

Array of ApiPolicyHttpRespV1 objects

Web policy backends.

Table 16 AuthOpt

Parameter

Type

Description

app_code_auth_type

String

Indicates whether AppCode authentication is enabled. This parameter is valid only if auth_type is set to App. The default value is DISABLE.

  • DISABLE: AppCode authentication is disabled.

  • HEADER: AppCode authentication is enabled and the AppCode is located in the header.

Table 17 ApiFunc

Parameter

Type

Description

function_urn

String

Function URN.

network_type

String

Network architecture type of the function. Options:

  • V1: non-VPC

  • V2: VPC

remark

String

Description.

invocation_type

String

Invocation mode.

  • async: asynchronous

  • sync: synchronous

version

String

Version of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

alias_urn

String

Alias URN of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

timeout

Integer

Timeout allowed for APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

authorizer_id

String

Backend custom authorizer ID.

id

String

ID.

register_time

String

Registration time.

status

Integer

Backend status:

  • 1: Valid

update_time

String

Modification time.

Table 18 ApiMock

Parameter

Type

Description

remark

String

Description.

result_content

String

Response.

version

String

Version. Ensure that the version does not exceed 64 characters.

authorizer_id

String

Backend custom authorizer ID.

status_code

Integer

Customized status code of the mock backend:

"200": "OK",

"201": "Created",

"202": "Accepted",

"203": "NonAuthoritativeInformation",

"204": "NoContent",

"205": "ResetContent",

"206": "PartialContent",

"300": "MultipleChoices",

"301": "MovedPermanently",

"302": "Found",

"303": "SeeOther",

"304": "NotModified",

"305": "UseProxy",

"306": "Unused",

"307": "TemporaryRedirect",

"400": "BadRequest",

"401": "Unauthorized",

"402": "PaymentRequired",

"403": "Forbidden",

"404": "NotFound",

"405": "MethodNotAllowed",

"406": "NotAcceptable",

"407": "ProxyAuthenticationRequired",

"408": "RequestTimeout",

"409": "Conflict",

"410": "Gone",

"411": "LengthRequired",

"412": "PreconditionFailed",

"413": "RequestEntityTooLarge",

"414": "RequestURITooLong",

"415": "UnsupportedMediaType",

"416": "RequestedRangeNotSatisfiable",

"417": "ExpectationFailed",

"450": "ParameterRequried",

"451": "MethodConnectException",

"500": "InternalServerError",

"501": "NotImplemented",

"502": "BadGateway",

"503": "ServiceUnavailable",

"504": "GatewayTimeout",

"505": "HTTPVersionNotSupported"

header

String

Custom response header of the mock backend.

Format: [{"key":"","value": "", "remark:""}, {"key2":"","value2": "","remark2:""}]

Description:

key: key of the mock backend's custom response header. It must start with a letter or digit, and can include only letters, digits, and hyphens (-) (max. 64 characters).

value: value of the mock backend's custom response header. This parameter cannot be empty (max. 10,240 characters).

remark: remark of the mock backend's custom response header. This parameter can be empty (max. 2048 characters).

id

String

ID.

register_time

String

Registration time.

status

Integer

Backend status:

  • 1: Valid

update_time

String

Modification time.

Table 19 ReqParam

Parameter

Type

Description

name

String

Parameter name.

The value can contain letters, digits, hyphens (-), underscores (_), and periods (.) and must start with a letter.

type

String

Parameter type.

location

String

Parameter location.

default_value

String

Default value.

sample_value

String

Example value.

required

Integer

Indicates whether the parameter is mandatory.

  • 1: The parameter is mandatory.

  • 2: The parameter is optional.

The value of this parameter is 1 if Location is set to PATH, and 2 if Location is set to another value.

valid_enable

Integer

Indicates whether validity check is enabled.

  • 1: enabled

  • 2: disabled

remark

String

Description.

enumerations

String

Enumerated value.

min_num

Integer

Minimum value.

This parameter is valid when type is set to NUMBER.

max_num

Integer

Maximum value.

This parameter is valid when type is set to NUMBER.

min_size

Integer

Minimum length.

This parameter is valid when type is set to STRING.

max_size

Integer

Maximum length.

This parameter is valid when type is set to STRING.

regular

String

Regular expression validation rule.

This parameter is currently not supported.

json_schema

String

JSON validation rule.

This parameter is currently not supported.

pass_through

Integer

Indicates whether to transparently transmit the parameter.

  • 1: The parameter is transparently transmitted.

  • 2: The parameter is not transparently transmitted.

orchestrations

Array of strings

Request parameter orchestration rules.

Request parameter orchestration rules are prioritized in the same sequence as the list.

The none_value rule in a rule list has the highest priority. A maximum of one none_value rule can be bound.

The default rule in a rule list has the lowest priority. A maximum of one default rule can be bound.

The preprocessing orchestration rule cannot be used as the last orchestration rule except the default rule.

Only one parameter of each API can be bound with unique orchestration rules. The number of orchestration rules that can be bound is limited by quota. For details, see "Quotas" in ROMA Connect Service Overview.

id

String

Parameter ID.

Table 20 ApiPolicyFunctionResp

Parameter

Type

Description

function_urn

String

Function URN.

network_type

String

Network architecture type of the function. Options:

  • V1: non-VPC

  • V2: VPC

invocation_type

String

Invocation mode.

  • async: asynchronous

  • sync: synchronous

timeout

Integer

Timeout allowed for APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

version

String

Version of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

alias_urn

String

Alias URN of a function.

If both the alias URN and version are specified, the version is ignored and only the alias URN is used.

id

String

ID.

name

String

Backend name, which must start with a letter and can contain letters, digits, and underscores (_).

conditions

Array of ConditionResp objects

Policy conditions

backend_params

Array of BackendParam objects

Backend parameters

effect_mode

String

Effective mode of the backend policy.

  • ALL: All conditions are met.

  • ANY: Any condition is met.

authorizer_id

String

Backend custom authorizer ID.

Table 21 ApiPolicyMockResp

Parameter

Type

Description

id

String

ID.

name

String

Backend name, which must start with a letter and can contain letters, digits, and underscores (_).

conditions

Array of ConditionResp objects

Policy conditions

backend_params

Array of BackendParam objects

Backend parameters

effect_mode

String

Effective mode of the backend policy.

  • ALL: All conditions are met.

  • ANY: Any condition is met.

authorizer_id

String

Backend custom authorizer ID.

result_content

String

Response.

status_code

Integer

Customized status code of the mock backend:

"200": "OK",

"201": "Created",

"202": "Accepted",

"203": "NonAuthoritativeInformation",

"204": "NoContent",

"205": "ResetContent",

"206": "PartialContent",

"300": "MultipleChoices",

"301": "MovedPermanently",

"302": "Found",

"303": "SeeOther",

"304": "NotModified",

"305": "UseProxy",

"306": "Unused",

"307": "TemporaryRedirect",

"400": "BadRequest",

"401": "Unauthorized",

"402": "PaymentRequired",

"403": "Forbidden",

"404": "NotFound",

"405": "MethodNotAllowed",

"406": "NotAcceptable",

"407": "ProxyAuthenticationRequired",

"408": "RequestTimeout",

"409": "Conflict",

"410": "Gone",

"411": "LengthRequired",

"412": "PreconditionFailed",

"413": "RequestEntityTooLarge",

"414": "RequestURITooLong",

"415": "UnsupportedMediaType",

"416": "RequestedRangeNotSatisfiable",

"417": "ExpectationFailed",

"450": "ParameterRequried",

"451": "MethodConnectException",

"500": "InternalServerError",

"501": "NotImplemented",

"502": "BadGateway",

"503": "ServiceUnavailable",

"504": "GatewayTimeout",

"505": "HTTPVersionNotSupported"

header

String

Custom response header of the mock backend.

Format: [{"key":"","value": "", "remark:""}, {"key2":"","value2": "","remark2:""}]

Description:

key: key of the mock backend's custom response header. It must start with a letter or digit, and can include only letters, digits, and hyphens (-) (max. 64 characters).

value: value of the mock backend's custom response header. This parameter cannot be empty (max. 10,240 characters).

remark: remark of the mock backend's custom response header. This parameter can be empty (max. 2048 characters).

Table 22 ConditionResp

Parameter

Type

Description

req_param_name

String

Input parameter name. This parameter is required if the policy type is param.

sys_param_name

String

System parameter name. This parameter is mandatory when the policy type is set to system. The following system parameters are supported:

  • req_path: request path, such as /a/b

  • req_method: request method, such as GET

cookie_param_name

String

COOKIE parameter name. This parameter is required if the policy type is cookie.

frontend_authorizer_param_name

String

Frontend authorizer parameter name (system parameter). This parameter is required if the policy type is frontend_authorizer. The frontend authentication parameter name is prefixed with $context.authorizer.frontend. For example, if the frontend authentication parameter name is user_name, add the prefix and the value is $context.authorizer.frontend.user_name.

condition_type

String

Policy condition.

  • exact: Exact match.

  • enum: Enumeration.

  • pattern: Regular expression.

This parameter is mandatory when the policy type is param, cookie, or frontend_authorizer.

condition_origin

String

Policy type

  • param: Parameter.

  • source: Source IP.

  • system: Built-in gateway parameter (system parameter).

  • cookie: COOKIE parameter.

  • frontend_authorizer: Frontend authorizer parameter (system parameter).

  • orchestration: Parameter orchestration rule.

condition_value

String

Policy value, which is required when the policy type is param, source, cookie, or frontend_authorizer.

mapped_param_name

String

Name of a parameter generated after orchestration. This parameter is mandatory when condition_origin is set to orchestration. The generated parameter name must exist in the orchestration rule bound to the API.

mapped_param_location

String

Location of a parameter generated after orchestration. This parameter is mandatory when condition_origin is set to orchestration. This location must exist in the orchestration rule bound to the API.

id

String

ID.

req_param_id

String

Input parameter ID.

req_param_location

String

Input parameter location.

Table 23 BackendParam

Parameter

Type

Description

name

String

Parameter name,

which must start with a letter and can only contain letters, digits, hyphens (-), underscores (_), and periods (.).

location

String

Parameter location. The value can be PATH, QUERY, or HEADER.

origin

String

Parameter type. The value can be REQUEST, CONSTANT, and SYSTEM.

value

String

Parameter value, with a maximum of 255 characters.

If the origin type is REQUEST, the value of this parameter is the parameter name in req_params.

If the origin type is CONSTANT, the value is a constant.

If the origin type is SYSTEM, the value is a system parameter name. System parameters include gateway parameters, frontend authentication parameters, and backend authentication parameters. You can set the frontend or backend authentication parameters after enabling custom frontend or backend authentication.

The gateway parameters are as follows:

  • $context.sourceIp: source IP address of the API caller

  • $context.stage: deployment environment in which the API is called

  • $context.apiName: API name

  • $context.apiId: API ID

  • $context.appName: name of the app used by the API caller

  • $context.appId: ID of the app used by the API caller

  • $context.requestId: request ID generated when the API is called

  • $context.serverAddr: address of the gateway server

  • $context.serverName: name of the gateway server

  • $context.handleTime: processing time of the API request

  • $context.providerAppId: ID of the app used by the API owner (not supported)

  • $context.clientCertCN: client certificate CN carried in the API invoking when client authentication is enabled

Frontend authentication parameter: prefixed with "$context.authorizer.frontend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.frontend.aaa".

Backend authentication parameter: prefixed with "$context.authorizer.backend.". For example, to return "aaa" upon successful custom authentication, set this parameter to "$context.authorizer.backend.aaa".

remark

String

Description.

id

String

Parameter ID.

req_param_id

String

Request parameter ID.

Table 24 BackendApiV1

Parameter

Type

Description

authorizer_id

String

Backend custom authorizer ID.

url_domain

String

Address of the backend service.

The value consists of the host (IP address or domain name) and port number. The total length cannot exceed 255 characters. The format is Host name:Port number (for example, apig.example.com:7443). If the port number is not specified, the default HTTPS port number is 443, and the default HTTP port number is 80.

Environment variables are supported. If environment variables are used, each variable name is a string of 3 to 32 characters. The string consists of letters, digits, underscores (_), and hyphens (-), and must start with an English letter.

req_protocol

String

Request protocol.

remark

String

Description.

req_method

String

Request method.

version

String

Web backend version, which can contain a maximum of 16 characters.

req_uri

String

Request URI. The value can contain request parameters identified by braces ({}), for example, /getUserInfo/{userId}. Special characters such as * / / %- _ . are supported. The total length cannot exceed 512 characters and must meet the URI specifications.

Environment variables are supported. If environment variables are used, each variable name is a string of 3 to 32 characters. The string consists of letters, digits, hyphens (-), and underscores (_) and must start with an English letter.

NOTE:

The value must comply with the URI specifications.

timeout

Integer

Timeout allowed for ROMA Connect APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

enable_client_ssl

Boolean

Whether to enable two-way authentication.

id

String

ID.

status

Integer

Backend status:

  • 1: Valid

register_time

String

Registration time.

update_time

String

Modification time.

vpc_info

String

VPC channel information.

vpc_status

Integer

Whether to use a VPC channel:

  • 1: yes

  • 2: no

Table 25 ApiPolicyHttpRespV1

Parameter

Type

Description

id

String

ID.

name

String

Backend name, which must start with a letter and can contain letters, digits, and underscores (_).

conditions

Array of ConditionResp objects

Policy conditions

backend_params

Array of BackendParam objects

Backend parameters

effect_mode

String

Effective mode of the backend policy.

  • ALL: All conditions are met.

  • ANY: Any condition is met.

authorizer_id

String

Backend custom authorizer ID.

url_domain

String

Endpoint of the policy backend. The value consists of a domain name (or an IP address) and a port number. The total length cannot exceed 255 characters. The value is in Domain name:Port number format, for example, apig.example.com:7443. If the port number is not specified, the default HTTPS port number is 443 and the default HTTP port number is 80.Environment variables are supported. If environment variables are used, each variable name must contain 3 to 32 characters, including letters, digits, underscores (_), and hyphens (-). The value must start with a letter.

req_protocol

String

Request protocol. The value can be HTTP or HTTPS.

req_method

String

Request method. The value can be GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS or ANY.

req_uri

String

Request URI. The value can contain request parameters identified by braces ({}), for example, /getUserInfo/{userId}. Special characters such as * / / %- _ . are supported. The total length cannot exceed 512 characters and must meet the URI specifications.

Environment variables are supported. If environment variables are used, each variable name is a string of 3 to 32 characters. The string consists of letters, digits, hyphens (-), and underscores (_) and must start with an English letter.

NOTE:

The value must comply with the URI specifications.

timeout

Integer

Timeout allowed for ROMA Connect APIC to request the backend service. You can set the maximum timeout using the backend_timeout configuration item. The maximum value is 600,000.

Unit: ms

enable_client_ssl

Boolean

Whether to enable two-way authentication.

vpc_info

String

VPC channel information.

vpc_status

Integer

Whether to use a VPC channel:

  • 1: yes

  • 2: no

Status code: 400

Table 26 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 27 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 28 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 29 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 30 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

  • API for creating a web backend

    {
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "match_mode" : "NORMAL",
      "name" : "Api_http",
      "auth_type" : "AUTHORIZER",
      "authorizer_id" : "0d982c1ac3da493dae47627b6439fc5c",
      "backend_type" : "HTTP",
      "backend_api" : {
        "url_domain" : "10.10.10.156:12346",
        "req_protocol" : "HTTP",
        "req_method" : "GET",
        "req_uri" : "/test/benchmark",
        "timeout" : 5000
      },
      "req_protocol" : "HTTPS",
      "req_uri" : "/test/http",
      "remark" : "Web backend API",
      "type" : 1,
      "req_method" : "GET",
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "tags" : [ "webApi" ],
      "req_params" : [ {
        "name" : "query_demo",
        "location" : "QUERY",
        "type" : "STRING",
        "required" : 1
      }, {
        "name" : "header-demo",
        "location" : "HEADER",
        "type" : "STRING",
        "required" : 2
      } ],
      "backend_params" : [ {
        "name" : "backHeader",
        "value" : "header-demo",
        "location" : "HEADER",
        "origin" : "REQUEST"
      }, {
        "name" : "backQuery",
        "value" : "query_demo",
        "location" : "QUERY",
        "origin" : "REQUEST"
      }, {
        "name" : "X-CONSTANT-HEADER",
        "value" : "demo",
        "location" : "HEADER",
        "origin" : "CONSTANT",
        "remark" : "constant_demo"
      }, {
        "name" : "app-id",
        "value" : "$context.appId",
        "location" : "HEADER",
        "origin" : "SYSTEM",
        "remark" : "consumer app id"
      } ]
    }
  • API for creating a FunctinGraph backend

    {
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "match_mode" : "NORMAL",
      "name" : "Api_function",
      "auth_type" : "APP",
      "backend_type" : "FUNCTION",
      "func_info" : {
        "authorizer_id" : "5b8cd3f06f004115aec69c58f57272c9",
        "function_urn" : "'urn:fss:region01:73d69ae0cfcf460190522d06b60f05ad:function:default:auto_testfunc93749'",
        "invocation_type" : "sync",
        "timeout" : 5000,
        "version" : "latest"
      },
      "req_protocol" : "HTTPS",
      "req_uri" : "/test/function",
      "remark" : "function API",
      "type" : 1,
      "req_method" : "GET",
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "tags" : [ "functionApi" ]
    }
  • API for creating a Mock backend

    {
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "match_mode" : "SWA",
      "name" : "Api_mock",
      "auth_type" : "IAM",
      "backend_type" : "MOCK",
      "mock_info" : {
        "result_content" : "mock success"
      },
      "policy_mocks" : [ {
        "name" : "mock_policy_backend",
        "effect_mode" : "ANY",
        "result_content" : "mock policy success",
        "conditions" : [ {
          "condition_origin" : "source",
          "condition_value" : "1.0.1.0"
        } ]
      } ],
      "req_protocol" : "HTTPS",
      "req_uri" : "/test/mock",
      "remark" : "mock api",
      "type" : 1,
      "req_method" : "GET",
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "tags" : [ "mockApi" ]
    }

Example Responses

Status code: 201

Created

  • Example 1

    {
      "id" : "5f918d104dc84480a75166ba99efff21",
      "tags" : [ "webApi" ],
      "arrange_necessary" : 2,
      "backend_type" : "HTTP",
      "auth_type" : "AUTHORIZER",
      "auth_opt" : {
        "app_code_auth_type" : "DISABLE"
      },
      "authorizer_id" : "0d982c1ac3da493dae47627b6439fc5c",
      "backend_api" : {
        "update_time" : "2020-07-31T12:42:51.325312994Z",
        "vpc_status" : 2,
        "url_domain" : "10.10.10.156:12346",
        "req_protocol" : "HTTP",
        "id" : "1ce8fda3586d4371bd83c955df37e102",
        "req_method" : "GET",
        "register_time" : "2020-07-31T12:42:51.325312721Z",
        "req_uri" : "/benchmark",
        "timeout" : 5000,
        "status" : 1
      },
      "cors" : false,
      "status" : 1,
      "group_name" : "api_group_001",
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "group_version" : "V1",
      "response_id" : "981e6c8f847f47199a9faf4409b751a5",
      "match_mode" : "NORMAL",
      "name" : "Api_http",
      "req_protocol" : "HTTPS",
      "req_method" : "GET",
      "req_uri" : "/test/http",
      "type" : 1,
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "version" : "V0.0.1",
      "register_time" : "2020-07-31T12:42:51.314357035Z",
      "update_time" : "2020-07-31T12:42:51.314357324Z",
      "remark" : "Web backend API",
      "req_params" : [ {
        "name" : "query_demo",
        "location" : "QUERY",
        "type" : "STRING",
        "valid_enable" : 2,
        "required" : 1,
        "id" : "57c8bf3c97ef40ee94eace95dff30014",
        "pass_through" : 1
      }, {
        "name" : "header-demo",
        "location" : "HEADER",
        "type" : "STRING",
        "valid_enable" : 2,
        "required" : 2,
        "id" : "8d993be96980415faa6b1fb2ebd647e0",
        "pass_through" : 1
      } ],
      "backend_params" : [ {
        "name" : "backHeader",
        "value" : "header-demo",
        "location" : "HEADER",
        "origin" : "REQUEST",
        "id" : "709f0ea376b44aaf907aaaa37d8cce92",
        "req_param_id" : "8d993be96980415faa6b1fb2ebd647e0"
      }, {
        "name" : "backQuery",
        "value" : "query_demo",
        "location" : "QUERY",
        "origin" : "REQUEST",
        "id" : "2f152d0fb54445039158d29c2a4f69ee",
        "req_param_id" : "57c8bf3c97ef40ee94eace95dff30014"
      }, {
        "name" : "X-CONSTANT-HEADER",
        "value" : "demo",
        "location" : "HEADER",
        "origin" : "CONSTANT",
        "remark" : "constant_demo",
        "id" : "20142102c6aa4f3c97d5fd6ef4010ac2"
      }, {
        "name" : "app-id",
        "value" : "$context.appId",
        "location" : "HEADER",
        "origin" : "SYSTEM",
        "remark" : "consumer app id",
        "id" : "a1349c61016e4d999ca783a50bfeee2b"
      } ]
    }
  • Example 2

    {
      "id" : "abd9c4b2ff974888b0ba79be7e6b2763",
      "arrange_necessary" : 2,
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "group_name" : "api_group_001",
      "group_version" : "V1",
      "match_mode" : "NORMAL",
      "name" : "Api_function",
      "auth_type" : "APP",
      "auth_opt" : {
        "auth_code_auth_type" : "DISABLE"
      },
      "backend_type" : "FUNCTION",
      "func_info" : {
        "id" : "c0740524cd4c40e3801a7afe5375f8b0",
        "authorizer_id" : "5b8cd3f06f004115aec69c58f57272c9",
        "function_urn" : "'urn:fss:region01:73d69ae0cfcf460190522d06b60f05ad:function:default:auto_testfunc93749'",
        "invocation_type" : "sync",
        "timeout" : 5000,
        "version" : "latest",
        "register_time" : "2020-08-02T15:36:19.897262803Z",
        "update_time" : "2020-08-02T15:36:19.897262993Z",
        "status" : 1
      },
      "cors" : false,
      "req_protocol" : "HTTPS",
      "req_uri" : "/test/function",
      "remark" : "function api",
      "type" : 1,
      "version" : "V0.0.1",
      "status" : 1,
      "req_method" : "GET",
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "tags" : [ "functionApi" ],
      "register_time" : "2020-08-02T15:36:19.892012381Z",
      "update_time" : "2020-08-02T15:36:19.892012627Z"
    }
  • Example 3

    {
      "id" : "3a955b791bd24b1c9cd94c745f8d1aad",
      "arrange_necessary" : 2,
      "group_id" : "c77f5e81d9cb4424bf704ef2b0ac7600",
      "group_name" : "api_group_001",
      "group_version" : "V1",
      "match_mode" : "SWA",
      "name" : "Api_mock",
      "auth_type" : "IAM",
      "auth_opt" : {
        "auth_code_auth_type" : "DISABLE"
      },
      "backend_type" : "MOCK",
      "mock_info" : {
        "id" : "e74bbc75825c4c38ae84ccab6bdc6175",
        "result_content" : "mock success",
        "update_time" : "2020-08-02T15:56:52.301790686Z",
        "register_time" : "2020-08-02T15:56:52.301790367Z"
      },
      "policy_mocks" : [ {
        "name" : "mock api",
        "id" : "1cb05173a4c84b7d996e30145cce3c7d",
        "effect_mode" : "ANY",
        "result_content" : "mock policy success",
        "conditions" : [ {
          "condition_origin" : "source",
          "condition_value" : "1.0.1.0",
          "id" : "8650b3a94e7344df8251658d8aee1f6d"
        } ]
      } ],
      "cors" : false,
      "req_protocol" : "HTTPS",
      "req_uri" : "/test/mock",
      "remark" : "mock api",
      "type" : 1,
      "version" : "V0.0.1",
      "req_method" : "GET",
      "result_normal_sample" : "normal result",
      "result_failure_sample" : "failure result",
      "tags" : [ "mockApi" ],
      "register_time" : "2020-08-02T15:56:52.286099413Z",
      "update_time" : "2020-08-02T15:56:52.286099715Z",
      "status" : 1
    }

Status code: 400

Bad Request

{
  "error_code" : "APIG.2011",
  "error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "APIG.3019",
  "error_msg" : "The function URN does not exist"
}

Status code: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

Status Codes

Status Code

Description

201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback