- After creating a group, go to the group details page to obtain the second-level domain name for this group, as shown in the preceding figure.
- Go to the website from which the external independent domain name globalservice.api.com was bought and resolve the domain name’s CNAME to the group’s second-level domain name.
- After resolving the CNAME, return to the group details page and click Bind Domain Name to bind globalservice.api.com to this group.
- As the backend uses HTTPS, an SSL certificate needs to be uploaded. The certificate content needs to be copied and pasted over because file uploading is not supported.
Basic Info sets the API group, API name, and API authentication method and type, as well as completes the API description.
Go to the API list page, as shown in the preceding figure.
Select the region same as the API group’s.
Pay attention to security authentication.
- Alibaba Cloud APP: Indicates that, when a customer calls your API, the API gateway will verify the APPkey and Secret, and the customer’s identity will not be authenticated.
- No Authentication: Indicates that anyone who acquires the call method can call your API, and callers cannot be individually metered. It is not recommended that APIs without authentication be available on the data marketplace.
Select the API type.
- Public: Indicates that anyone can view this API on the “Discover APIs“ page. When APIs are available on the data marketplace, only public APIs in the group will be available.
- Private: Indicates that no one can see this API, unless authorization is granted to an APP. When a group is available on the data marketplace, the private APIs in the group will not be available.
Define API request completes the request format that a third-party user, namely the frontend, uses to call APIs on the data marketplace.
First, configure the protocol, Path, and Method. Refer to the following figure.
Configure the protocol.
- The frontend configuration support both HTTP and HTTPS simultaneously. If the backend supports HTTPS, an SSL certificate must be assigned to the independent domain name.
Configure the request path.
Path indicates the part after .com and before ? in the URL when you call an API. For details about the scenario when Path contains dynamic parameters, refer to the backend configuration process in the following sections.
If the front part of the URL you call is:
Your Path is:
Set Method to Post because an API with Body is to be demonstrated.
The input parameter definition describes the parameters that must be passed over when you call an API.
The API gateway input parameter configuration supports different parameter orders. You can configure all the parameters together and select the parameter positions, including Header, Query, Body, or Path. Building on the initial example, the input parameter configuration is as follows:
- Note that the names of parameters are verified for uniqueness.
- Once again, note that this step configures the input parameters when you call an API, namely how the frontend is displayed. To configure the five parameters in this step, you need to transmit the part after ? in the URL to the command and region in the format of keyvalue, and configure the part in Query. Also, key1, key2, and group parameters must be transmitted in Body Form and configured on Body.
- You can use the shortcuts on the left to quickly adjust the parameter order, in relation to display definitions.
Now configuration of the frontend input parameters is complete. The next process is to configure the backend service definitions.