هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

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
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

Calling an Open API

Updated on 2024-11-27 GMT+08:00

After an API is published in an environment, it can be called by other users. API calling operations vary by the authentication mode used by the API.

Constraints

  • If you use the default subdomain name to access an API, you can access the API a maximum of 1000 times every day.
  • If there are two APIs with the same group, request method, and request path, the API with exact matching is first called.

Prerequisites

Before calling an API, ensure that the network of your service system can communicate with the API access domain name or address. This depends on where your service system is in relative to the ROMA Connect instance.

  • The same VPC: Let the instance directly access the API.
  • Two VPCs in the same region: Connect the instance and the service system with a peering connection. For details, see VPC Peering Connection.
  • Two VPCs in two regions: Create a cloud connection and load the VPCs that need to communicate with each other. For details, see Network Communications Among VPCs Across Regions.
  • Communication over the public network: Ensure that the instance must be bound with an EIP.

Obtaining API Calling Information

Obtain the API calling information from the API provider before you call an API.

  • Request information

    On the ROMA Connect instance console, choose API Connect > APIs and obtain the domain name, request method, and URL of an API. Click the API name to go to the details page. Click the Frontend Configuration tab on the APIs page, obtain the request parameters and request body of the API.

  • Authentication information

    Obtain the request authentication information according to the authentication mode used by an API.

    Authentication Mode

    Authentication Info Needed

    App authentication (with a signature)

    Key and secret of the credential authorized by the API from the API provider, as well as the SDK, for authentication signatures.

    App authentication (through simple authentication)

    AppCode of the credential authorized by the API from the API provider.

    App authentication (with green channel whitelisting)

    Key of the credential authorized by the API from the API provider.

    App authentication (with app_secret)

    Key and secret of the credential authorized by the API from the API provider.

    App authentication (with app_basic)

    Key and secret of the credential authorized by the API from the API provider.

    App authentication (two-factor)

    Authentication information required for App authentication and custom authentication.

    IAM authentication (with a token)

    Username and password of the cloud service platform.

    IAM authentication (with AK/SK)

    AK/SK of the account on the cloud service platform and the SDK used for signatures.

    IAM authentication (two-factor)

    Information required for IAM authentication and custom authentication.

    Custom authentication

    Information to be carried in the request parameters from the API provider.

    None

    No information is required.

    • Key and secret of a credential

      On the ROMA Connect instance console, choose API Connect > Credentials. Click the name of a credential authorized by the API. On the page displayed, obtain the key and secret of the credential.

    • SDK used for authentication signatures

      On the ROMA Connect instance console, choose API Connect > Credentials. Download the SDK of the required language on the SDKs page.

    • AppCodes

      On the ROMA Connect instance console, choose API Connect > Credentials. Click the name of a credential authorized by the API. On the page displayed, obtain an AppCode of the credential in the AppCodes area.

Calling an API

  1. Example API request
    POST https://{Address}/{Path}?{Query}
    {Header}
    
    {
      {Body}
    }
    • POST: request method. Use the actual request method obtained in Obtaining API request information.
    • {Address}: request address. Use the actual request address obtained in Obtaining API request information. You can also use an IP address to access an API.

      Scenario

      API Request Parameter Configuration

      Using a domain name to call an API

      ROMA Connect allows APIs to be called using the subdomain name assigned to the API group or the domain name bound to the API group. No additional configuration is required.

      Calling an API in the DEFAULT group with an IP address

      Call an API in the DEFAULT group with an IP address. No additional configuration is required.

      Calling an API not in the DEFAULT group with an IP address

      • The app_route parameter described in Modifying Instance Configuration Parameters has been set to on for a ROMA Connect instance, indicating that an API can be called by using an IP address.
      • ROMA Connect does not allow APIs in non-DEFAULT groups to be directly called using IP addresses. The header parameter X-HW-ID must be added to the request message, and the value must be the key of the credential authorized by the API.
    • {Path}: request path. Use the actual URL obtained in Obtaining API request information.
    • (Optional) {Query}: query parameter in Parameter_name=Parameter_value format, for example, limit=10. Use & to separate multiple query parameters. For details, see the request parameters obtained in Obtaining API request information.
    • {Header}: request header parameter in Parameter_name:Parameter_value format, for example, Content-Type:application/json. For details, see the request parameters obtained in Obtaining API request information.
    • {Body}: request body in JSON format. For details, see the request body description obtained in Obtaining API request information.
  1. Add authentication information for the API request.

    API Authentication Mode

    API Request Parameter Configuration

    App authentication (with a signature)

    Obtain the SDK to sign the API request. For details, see Developing API Calling Authentication (App).

    App authentication (through simple authentication)

    Add the header parameter X-Apig-AppCode to the API request. The parameter value is the AppCode obtained in Obtaining API authentication information.

    App authentication (with green channel whitelisting)

    Add the header parameter X-HW-ID to the API request. The parameter value is the key obtained in Obtaining API authentication information.

    App authentication (with app_secret)

    App authentication (with app_basic)

    App authentication (two-factor)

    An API request carries authentication information of both App authentication and custom authentication.

    IAM authentication (with a token)

    Obtain the authentication token from the cloud service platform, add the header parameter X-Auth-Token to the API request, and set the value to the authentication token. For details, see Token Authentication.

    IAM authentication (with AK/SK)

    Obtain the SDK to sign the API request. For details, see AK/SK Authentication.

    IAM authentication (two-factor)

    An API request carries authentication information of both IAM authentication and custom authentication.

    Custom authentication

    Based on the definition of custom authentication, the related authentication information is carried in the API request parameters for authentication.

    None

    No authentication is required, and the API can be directly called.

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