Publishing an API
Function
This API is used to publish an API in a specified environment. An API can be called in an environment only after it is published in it. APIs that have not been published cannot be called.
URI
The following table lists the HTTP/HTTPS request method and URI of the API.
|
Request Method |
URI |
|---|---|
|
POST |
/v1/{project_id}/apigw/instances/{instance_id}/apis/publish/{api_id} |
The following table lists the parameters in the URI.
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID, which can be obtained by the administrator on the My Credentials page. |
|
instance_id |
Yes |
String |
Instance ID, which can be obtained from the dedicated gateway information on the API Gateway console. |
|
api_id |
Yes |
String |
API ID |
Request
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
env_id |
Yes |
String |
ID of the environment in which the API will be published |
|
remark |
No |
String |
Description about the publication The description cannot exceed 255 characters. |
Example request:
{
"env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID",
"remark": "Published in the production environment"
}
Response
|
Parameter |
Type |
Description |
|---|---|---|
|
publish_id |
String |
ID of the publication record |
|
api_id |
String |
API ID |
|
env_id |
String |
ID of the environment in which the API has been published |
|
remark |
String |
Description about the publication |
|
publish_time |
Timestamp |
Time when the API is published |
|
version_id |
String |
Version |
Example response:
{
"publish_id": "5b729aa252764739be2c37ef0d66dc63",
"api_id": "7addcd00cfab433984b1d8bf2fe08aaa",
"env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID",
"version_id": "3d9dcb733ba34352b0d02f85fd16b026",
"remark": "string",
"publish_time": "2018-07-26T13:18:04.1079916Z"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Created |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
Not Found |
|
500 |
Server Internal Error |
Last Article: Deleting an API
Next Article: Taking an API offline
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.