PUT /api/apis/{APIID}
Updates information about an API on the platform.
Note: Deprecated.
Instead, use the PUT /api/apis/versions/{ApiVersionID}/info operation.
Authorization Roles/Permissions: Must be logged in. Must have permission to modify the API; an API Admin or Business Admin.
This topic includes the following sections:
HTTP Method
PUT
URL
https://{hostname}/api/apis/{APIID}
Sample Request
The example below shows an update to a specific API.
Sample Request URL
https://{hostname}/api/apis/api18969.acmepaymentscorp
Sample request headers
PUT /api/apis/api18969.acmepaymentscorp HTTP/1.1 Host: {hostname} Accept: application/json, text/javascript, */*; q=0.01 Content-Type: application/json; charset=UTF-8 X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...
Sample request body #1: modifying API information
{ "Name":"acmepaymentscorp", "Description":"Payments API for ACME customers.", "Visibility":"Public", "PictureID":"1255", "APIVersion":{ "Visibility":"Public", "Name":"1.0", "Description":"First release.", "TargetAPI":{ "Endpoints":{ "Endpoint":[ { "Uri":"http://www.acme.com/api/v1/", "Category":"Production", "ConnectionProperties":[ { "Name":"http.chunked.encoding", "Value":"false" } ] }, { "Uri":"http://www.acme.com/apisandbox/v1/", "Category":"Sandbox", "ConnectionProperties":[ { "Name":"http.chunked.encoding", "Value":"false" } ] } ] }, "Type":"shttp", "Operations":{ "Operation":[ { "Method":"GET", "Path":"/{path:.+|}", "Input":[ { "Name":"path", "Type":"path" } ], "InputContentType":"application/xml,text/xml,application/json", "OutputContentType":"application/xml,text/xml,application/json", "FaultContentType":"application/xml,text/xml,application/json", "Name":"Default_Operation" } ] }, "Policies":{ "Policy":[ ] }, "DefaultProfile":"XML or JSON in/XML or JSON out" }, "Endpoints":{ "Endpoint":[ { "Uri":"http://acmepaymentscorp.broker.soa.com:80/payments", "Category":"Production", "CName":"acmepaymentscorp.broker.soa.com", "DeploymentZoneRule":"dzone-rule-1" }, { "Uri":"http://acmepaymentscorpsandbox.broker.soa.com:80/payments", "Category":"Sandbox", "CName":"acmepaymentscorpsandbox.broker.soa.com", "DeploymentZoneRule":"dzone-rule-1" } ] }, "Operations":{ "Operation":[ { "Method":"GET", "Path":"/{path:.+|}", "Input":[ { "Name":"path", "Type":"path" } ], "InputContentType":"application/xml,text/xml,application/json", "OutputContentType":"application/xml,text/xml,application/json", "FaultContentType":"application/xml,text/xml,application/json", "Name":"Default_Operation" } ] }, "Type":"shttp", "ProductionEndpoint":"http://acmepaymentscorp.broker.soa.com/payments", "SandboxEndpoint":"http://acmepaymentscorpsandbox.broker.soa.com/payments", "Tag":[ "payments API" ], "Policies":{ "Policy":[ { "PolicyKey":"urn:uuid:6282f78f-8a81-11e1-8112-b4822b49f412", "PolicyType":"Operational Policy" } ] }, "DefaultProfile":"XML or JSON in/XML or JSON out", "ProductionEndpointAccessAutoApproved":false, "SandboxEndpointAccessAutoApproved":true } }
Sample request body #2: adding an API version
The example below adds a new version to the API. The version information is included in the body of the JSON request.
{ "APIID":"api10017.acmepaymentscorp", "Name":"ACME Payments", "Description":"Payments API for ACME customers only.", "Visibility":"Limited", "LatestVersionID":"apiversion10020.acmepaymentscorp", "IsFollowed":true, "RatingSummary":{ "Five":0, "Four":0, "Three":0, "Two":0, "One":0 }, "AdminGroupID":"group10018.acmepaymentscorp", "Created":"2013-02-13T16:04:36.251Z", "Updated":"2013-02-13T16:28:39.733Z", "AvatarURL":"https://{hostname}/api/apis/api10017.acmepaymentscorp/avatar", "APIVersion":{ "APIID":"api10017.acmepaymentscorp", "Name":"1.2", "Description":"Next great version, 1.2!", "Type":"shttp", "DefaultProfile":"Any in and out", "Tag":[ "Payments", "ACME" ], "SandboxEndpoint":"https://acme_payments.acmepaymentscorp.soa.com/", "Operations":{ "Operation":[ { "Method":"POST", "Path":"/payments", "Input":[ ], "InputContentType":"*/*", "OutputContentType":"*/*", "FaultContentType":"*/*", "Name":"addPayment" }, { "Method":"GET", "Path":"/payments/{PaymentID}", "Input":[ { "Name":"PaymentID", "Type":"path" } ], "InputContentType":"*/*", "OutputContentType":"*/*", "FaultContentType":"*/*", "Name":"getPayment" } ] }, "Endpoints":{ "Endpoint":[ { "Uri":"https://acme_payments.acmepaymentscorp.soa.com/", "Category":"Sandbox", "CName":"acme_payments.acmepaymentscorp.soa.com", "DeploymentZoneRule":"dzone-rule-2" } ] }, "TargetAPI":{ "Endpoints":{ "Endpoint":[ { "Uri":"http://developer.acme.com", "Category":"Sandbox" } ] }, "Type":"shttp", "Operations":{ "Operation":[ { "Method":"POST", "Path":"/payments", "Input":[ ], "InputContentType":"application/json", "OutputContentType":"application/json", "FaultContentType":"application/json", "Name":"addPayment" }, { "Method":"GET", "Path":"/payments/{PaymentID}", "Input":[ { "Name":"PaymentID", "Type":"path" } ], "InputContentType":"application/json", "OutputContentType":"application/json", "FaultContentType":"application/json", "Name":"getPayment" } ] }, "Policies":{ "Policy":[ ] }, "DefaultProfile":"JSON in and out" }, "Visibility":"Limited", "Created":"2013-02-13T16:28:24.332Z", "Updated":"2013-02-13T16:28:25.794Z", "State":"com.soa.api.state.open", "ProductionEndpointAccessAutoApproved":true, "SandboxEndpointAccessAutoApproved":true, "RatingSummary":{ "Five":0, "Four":0, "Three":0, "Two":0, "One":0 }, "ProductionEndpoint":null, "Policies":{ "Policy":[ ] } }, "PictureID":"" }
Request Headers
For general information on request header values, refer to HTTP Request Headers.
Header | Description |
---|---|
Accept |
application/json, application/xml application/vnd.soa.v71+json, application/vnd.soa.v71+xml application/vnd.soa.v72+json, application/vnd.soa.v72+xml application/vnd.soa.v80+json, application/vnd.soa.v80+xml |
Content-Type |
Any one of the following media types is valid for the request Content-Type: application/json or application/xml application/vnd.soa.v71+json or application/vnd.soa.v71+xml application/vnd.soa.v72+json or application/vnd.soa.v72+xml application/vnd.soa.v80+json or application/vnd.soa.v80+xml |
Cookie | AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies. |
X-Csrf-Token_{fedmemberID} | The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login. |
Request Parameters
Parameter | Parm Type | Data Type | Required | Description |
---|---|---|---|---|
APIID | Path | String | Required |
The unique ID for a specific API. In this case it is the API to be updated. |
API | Body | API | Required | Contains information about an API. |
Response
If successful, this operation returns HTTP status code 200, with the complete updated API object.
Sample Response
The sample response below shows the updated object returned in the response.
Sample response headers
HTTP/1.1 200 OK Date: Fri, 18 Jan 2013 09:10:45 GMT Content-Type: application/json
Sample response body: application/json
{ "APIID" : "api18969.acmepaymentscorp", "Name" : "acmepaymentscorp", "Description" : "Payments API for ACME customers.", "Visibility" : "Public", "LatestVersionID" : "apiversion18971.acmepaymentscorp", "Tag" : [ ], "IsFollowed" : false, "RatingSummary" : { "Five" : 0, "Four" : 0, "Three" : 0, "Two" : 0, "One" : 0 }, "APIVersion" : { "APIVersionID" : "apiversion18972.acmepaymentscorp", "APIID" : "api18969.acmepaymentscorp", "Name" : "1.1", "Type" : "shttp", "DefaultProfile" : "XML or JSON in/XML or JSON out", "Description" : "Update to first release includes key fixes.", "Tag" : [ "payments API" ], "State" : "com.soa.api.state.open", "ProductionEndpoint" : "http://acmepaymentscorp.broker.soa.com/payments", "SandboxEndpoint" : "http://acmepaymentscorpsandbox.broker.soa.com/payments", "Operations" : { "Operation" : [ { "Name" : "Default_Operation", "Method" : "GET", "Path" : "/{path:.+|}", "InputContentType" : "application/xml,text/xml,application/json", "OutputContentType" : "application/xml,text/xml,application/json", "FaultContentType" : "application/xml,text/xml,application/json", "Input" : [ { "Name" : "path", "Type" : "path" } ] } ] }, "Endpoints" : { "Endpoint" : [ { "CName" : "acmepaymentscorp.broker.soa.com", "Category" : "Production", "Uri" : "http://acmepaymentscorp.broker.soa.com:80/payments", "DeploymentZoneRule" : "dzone-rule-1", "ConnectionProperties" : [ ] }, { "CName" : "acmepaymentscorpsandbox.broker.soa.com", "Category" : "Sandbox", "Uri" : "http://acmepaymentscorpsandbox.broker.soa.com:80/payments", "DeploymentZoneRule" : "dzone-rule-1", "ConnectionProperties" : [ ] } ] }, "Policies" : { "Policy" : [ { "PolicyKey" : "urn:uuid:6282f78f-8a81-11e1-8112-b4822b49f412", "PolicyType" : "Operational Policy" } ] }, "TargetAPI" : { "Type" : "shttp", "DefaultProfile" : "XML or JSON in/XML or JSON out", "Endpoints" : { "Endpoint" : [ { "Category" : "Production", "Uri" : "http://www.acme.com/api/v11/", "ConnectionProperties" : [ { "Name" : "http.chunked.encoding", "Value" : "false" } ] }, { "Category" : "Sandbox", "Uri" : "http://www.acme.com/apisandbox/v11/", "ConnectionProperties" : [ { "Name" : "http.chunked.encoding", "Value" : "false" } ] } ] }, "Operations" : { "Operation" : [ { "Name" : "Default_Operation", "Method" : "GET", "Path" : "/{path:.+|}", "InputContentType" : "application/xml,text/xml,application/json", "OutputContentType" : "application/xml,text/xml,application/json", "FaultContentType" : "application/xml,text/xml,application/json", "Input" : [ { "Name" : "path", "Type" : "path" } ] } ] }, "Policies" : { "Policy" : [ ] } }, "Visibility" : "Public", "Created" : "2013-01-18T08:46:22Z", "Updated" : "2013-01-18T08:46:27Z", "ProductionEndpointAccessAutoApproved" : false, "SandboxEndpointAccessAutoApproved" : true, "RatingSummary" : { "Five" : 0, "Four" : 0, "Three" : 0, "Two" : 0, "One" : 0 } }, "AdminGroupID" : "group18970.acmepaymentscorp", "Created" : "2013-01-18T08:46:22Z", "Updated" : "2013-01-18T08:46:22Z", "AvatarURL" : "https://{hostname}/api/apis/api18969.acmepaymentscorp/avatars/a0af2266-2df8-46e7-971d-bee414a6e038.png" }
Response Headers
For general information on response header values, refer to HTTP Response Headers.
Header | Description |
---|---|
Content-Type |
application/json, application/xml application/vnd.soa.v71+json, application/vnd.soa.v71+xml application/vnd.soa.v72+json, application/vnd.soa.v72+xml application/vnd.soa.v80+json, application/vnd.soa.v80+xml |
Response Body
Name | Type | Description |
---|---|---|
API | API |
Contains information about an API. The full updated API information is returned. |
Error Codes/Messages
If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.
Item | Value |
---|---|
401 | Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing. |
500 | An error occurred processing the call. |
More information about Akana API Platform API error messages.