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
IoT
IoT Device Access
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
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
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
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
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
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
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Debugging an API

Updated on 2023-04-06 GMT+08:00

Function

This API is used to debug the definition of an API in a specified environment. The API caller must have the permissions required for operating this API.

URI

The following table lists the HTTP/HTTPS request method and URI of the API.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

POST

/v1.0/apigw/apis/debug/{api_id}

The following table lists the parameter in the URI.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

api_id

Yes

String

API ID

Request

Table 3 Parameter description

Parameter

Mandatory

Type

Description

scheme

Yes

String

Request protocol, which can be:

  • HTTP
  • HTTPS

method

Yes

String

Request method, which can be:

  • GET
  • POST
  • PUT
  • DELETE
  • HEAD
  • PATCH
  • OPTIONS

domain

No

String

Access domain name of the API. If no value is specified, one of the following default values will be used based on the setting of mode:

  • For DEVELOPER, the subdomain name of the API group will be used.
  • For MARKET, the domain name of the API group allocated by KooGallery will be used.
  • For CONSUMER, the subdomain name of the API group will be used.

path

Yes

String

Request path of the API, starting with a slash (/) and with up to 1024 characters

NOTE:

The request path must meet path requirements so that it can be correctly decoded after percent-encoding.

query

No

Dictionary

Query parameters, with each value being a character string array. Each parameter name must meet the following requirements:

  • Contains letters, digits, periods (.), hyphens (-), or underscores (_).
  • Starts with a letter, with a maximum length of 32 bytes.
  • Case-insensitive and not starts with X-Apig- or X-Sdk-.
  • Case-insensitive and cannot be X-Stage.

header

No

Dictionary

Header parameters, with each value being a character string array. Each parameter name must meet the following requirements:

  • Contains letters, digits, periods (.), and hyphens (-).
  • Starts with a letter, with a maximum length of 32 bytes.
  • Case-insensitive and not starts with X-Apig- or X-Sdk-.
  • Case-insensitive and cannot be X-Stage.
  • Case-insensitive and cannot be X-Auth-Token or Authorization when mode is set to MARKET or CONSUMER.
NOTE:

Each header name is normalized before use. For example, x-MY-hEaDer is normalized as X-My-Header.

body

No

String

Message body, with a maximum length of 2,097,152 bytes.

mode

Yes

String

Debugging mode, which can be:

  • DEVELOPER: debugs the definition of an API that has not been published.
  • MARKET: debugs the definition of an API purchased from KooGallery.
  • CONSUMER: debugs the definition of an API that has been published in a specified environment.
    NOTE:

    In DEVELOPER mode, the API caller must be the API owner.

    In MARKET mode, the API caller must be the API purchaser or owner.

    In CONSUMER mode, the API caller must be the API owner or has authorized its access to apps in the specified environment.

app_key

No

String

AppKey used in the debugging request

app_secret

No

String

AppSecret used in the debugging request

stage

No

String

Running environment specified in the debugging request. This parameter is valid only when mode is set to CONSUMER. If no value is specified, RELEASE is used.

Example request:

{
  "mode": "DEVELOPER",
  "scheme": "HTTPS",
  "method": "GET",
  "path": "/test",
  "query": {
    "city": [
      "city01",
      "city02"
    ]
  },
  "header": {
    "X-My-City": [
      "city01",
      "city02"
    ]
  }
}

Response

Table 4 Parameter description

Parameter

Type

Description

request

String

Body of the debugging request

response

String

Body of the debugging response, with a maximum length of 2,097,152 bytes. Any content beyond this threshold will be truncated.

NOTE:

Any content beyond the length limit will be truncated, and text [TRUNCATED] will be added to the response body.

latency

String

Debugging duration in milliseconds

log

String

Debugging logs

Example response:

{
  "request": "GET /test?city=city01&city=city02 HTTP/1.1\r\nHost: edf94892b11d440795562cb81c5be059.apigw.example.com\r\nUser-Agent: APIGatewayDebugClient/1.0\r\nX-Apig-Mode: debug\r\nX-My-City: city01\r\nX-My-City: city02\r\n\r\n",
  "response": "HTTP/1.1 200 OK\r\nContent-Length: 33\r\nConnection: keep-alive\r\nContent-Type: application/json; charset=utf-8\r\nDate: Fri, 24 Aug 2018 10:36:47 GMT\r\nServer: api-gateway\r\nX-Apig-Latency: 13\r\nX-Apig-Ratelimit-Api: remain:92,limit:100,time:1 minute\r\nX-Apig-Ratelimit-Api-Allenv: remain:9,limit:10,time:1 second\r\nX-Apig-Upstream-Latency: 1\r\nX-Request-Id: 12f69943cc2fa4f8a3674ee947655339\r\n\r\n{\"version\":\"4.0.12.201808190004\"}",
  "latency": "12",
  "log": ""
}

Status Codes

Table 5 Status codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

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