APIs
APIs provide a flexible way to invoke the V2 version APIs Connector. For creating V2 version APIs, see the documentation.
Note
The v3 version uses the open capabilities of the HTTP API when calling general APIs.
APIs Usage Reference
interface apis {
[apisLabel: string]: {
[
method: "request" | "post" | "get" | "head" | "patch" | "delete" | "put"
]: (
callApiOptions: ICallApiOptions,
opts?: IRequestOptions
) => Promise<ResponseObject["data"]>;
};
}
APIs module supports the following HTTP methods:
| Method | Description | Example |
|---|---|---|
| get | GET request | apis["apisLabel"].get(callApiOptions) |
| post | POST request | apis["apisLabel"].post(callApiOptions) |
| put | PUT request | apis["apisLabel"].put(callApiOptions) |
| delete | DELETE request | apis["apisLabel"].delete(callApiOptions) |
| head | HEAD request | apis["apisLabel"].head(callApiOptions) |
| patch | PATCH request | apis["apisLabel"].patch(callApiOptions) |
| request | Custom method request | apis["apisLabel"].request(callApiOptions) |
Tip
apisLabel is the APIs identifier, generated when creating the V2 version APIs Connector, and can be found in the connector's basic information.
参数
callApiOptions
ICallApiOptions
opts
IRequestOptions
Request object parameters, generally not required to be passed, include url, method, headers, and body. They serve as supplementary options for customization needs and will override parameters of the same name in callApiOptions.
返回
res
ResponseObject['data']
data content returned by the HTTP interface