Update an API
/apiplatform/management/v1/apis/{apiId}
Updates the {apiId}
API.
Users requesting this resource must be assigned the API Manager role and must be issued the Manage API grant for the specified API.
Request
- application/json
-
apiId: string
A unique ID referencing a specific API.
object
-
description(optional):
string
The API's description.
-
documentation(optional):
object documentation
Describes the API's documenation resource
-
icon(optional):
string
The API's icon.
-
overview(optional):
object overview
Describes the API's overview text resource.
object
object
-
data(optional):
string
The path to the documentation resource, if attached as a file, the URL of the resource, if added as a link, or the overview text itself, if entered as text.
-
dataType(optional):
string
The method used to attach documentation to the API. Valid values are
link
,file
, andtext
. The value islink
if Apiary documentation is added. -
doctype(optional):
string
The documentation type of the documentation resource. Valid values are markdown, html, and apiary.
object
-
data(optional):
string
The name of the resource, if attached as a file, the URL of the resource, if added as a link, or the overview text itself, if entered as text.
-
dataType(optional):
string
The method used to attach overview text to the API. Valid values are
link
,file
, andtext
. -
doctype(optional):
string
The documentation type of the overview text resource. Valid values are
markdown
andhtml
.
object
-
content(optional):
string
-
content-type:
string
The content type of the attached resource, like
text/html; charset=utf-8
. -
pathname:
string
The path to the API resource.
Response
- application/json
200 Response
object
-
iterationId(optional):
string
The API's iteration.
400 Response
object
-
detail(optional):
string
Detailed error message
-
errorCode(optional):
string
Application specific error code
-
errorDetails(optional):
array errorDetails
additional errors
-
errorPath(optional):
string
-
instance(optional):
string
URI to the link that provides more detail about the error
-
status(optional):
string
HTTP status code
-
title:
string
Summary error message
-
type:
string
Error type
403 Response
object
-
detail(optional):
string
Detailed error message
-
errorCode(optional):
string
Application specific error code
-
errorDetails(optional):
array errorDetails
additional errors
-
errorPath(optional):
string
-
instance(optional):
string
URI to the link that provides more detail about the error
-
status(optional):
string
HTTP status code
-
title:
string
Summary error message
-
type:
string
Error type
500 Response
object
-
detail(optional):
string
Detailed error message
-
errorCode(optional):
string
Application specific error code
-
errorDetails(optional):
array errorDetails
additional errors
-
errorPath(optional):
string
-
instance(optional):
string
URI to the link that provides more detail about the error
-
status(optional):
string
HTTP status code
-
title:
string
Summary error message
-
type:
string
Error type
Examples
The following example shows how to update an API by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL
curl -i -X PUT
-H "Authorization: Bearer token-key"
-H "Content-Type:application/json"
-d @update-api.json
https://example.com/apiplatform/management/v1/apis/{apiId}
{apiId}
is the unique ID for an API. To retrieve available API IDs, see Get APIs.
Example of Request Body
In the previous iteration of the API, the API Request and Service Request polices were applied as draft. The following example shows this API configuration.
{ "implementation": { "policies": [{ "id": "1", "type": "o:ApiRequest", "version": "1.0", "draft": true, "config": {} }, { "id": "2", "type": "o:ServiceRequest", "version": "1.0", "draft": true, "config": {} }, { "id": "3", "type": "o:ServiceResponse", "version": "1.0", "config": {} }, { "id": "4", "type": "o:ApiResponse", "version": "1.0", "config": {} } ], "executions": { "request": ["1", "2"], "response": ["3", "4"] } } }
The request body provided below, included with the request above in a file named update-api.json
, removes the draft status from the API Request and Service Request policies and adds the configuration details required by these policies.
{ "implementation": { "policies": [{ "id": "1", "type": "o:ApiRequest", "version": "1.0", "draft": false, "config": { "url": "maxtemp", "protocols": ["HTTP"] } }, { "id": "2", "type": "o:ServiceRequest", "version": "1.0", "draft": false, "config": { "url": "https://www.example/maxtemp", "useProxy": true } }, { "id": "3", "type": "o:ServiceResponse", "version": "1.0", "config": {} }, { "id": "4", "type": "o:ApiResponse", "version": "1.0", "config": {} } ], "executions": { "request": ["1", "2"], "response": ["3", "4"] } } }
Example of Response Headers
The following shows an example of the response headers.
HTTP/1.1 200 OK Server: Oracle-Traffic-Director/12.2.1.0.0 Date: Mon, 13 Mar 2017 07:24:25 GMT Content-Length: 19 Content-Type: application/json X-oracle-dms-ecid: f102c33f-1c5b-4409-806d-03bf5706c492-00018fc1 X-oracle-dms-rid: 0 Via: 1.1 otd_opc Proxy-agent: Oracle-Traffic-Director/12.2.1.0.0
Example of Response Body
The following example shows the contents of the response body in JSON format.
{ "iterationId": "2" }