Update an API

put

/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

Supported Media Types
Path Parameters
Body ()
Root Schema : UpdateApiRequest
Match All
Show Source
Nested Schema : ApiDetails
Type: object
Show Source
Nested Schema : ApiImpl
Type: object
Nested Schema : ApiArtifacts
Type: object
Show Source
Nested Schema : documentation
Type: object
Describes the API's documenation resource
Show Source
  • 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.
  • The method used to attach documentation to the API. Valid values are link, file, and text. The value is link if Apiary documentation is added.
  • The documentation type of the documentation resource. Valid values are markdown, html, and apiary.
Nested Schema : overview
Type: object
Describes the API's overview text resource.
Show Source
  • 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.
  • The method used to attach overview text to the API. Valid values are link, file, and text.
  • The documentation type of the overview text resource. Valid values are markdown and html.
Nested Schema : artifacts
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

The API was updated.
Body ()
Root Schema : ApiIterationId
Type: object
Show Source

400 Response

Bad request, indicates a problem with the input parameters.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source

403 Response

Forbidden.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source

500 Response

Unexpected error.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source
Back to Top

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"
}
Back to Top