PUT /api/apis/{APIID}

Updates information about an API on the platform.

To get the current model object for the API, as a basis for updating, you could run the GET /api/apis/{APIID} operation.

Note: This operation has been used in the past to add an API version. It still has that capability, for backwards compatibility. However, to add a new API version, it's best to use the POST /api/apis/{APIID}/versions 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

Back to top

URL

https://{hostname}/api/apis/{APIID}

Back to top

Sample Request

The example below shows an update to a specific API.

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":""
}

Back to top

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

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.

Back to top

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 Includes information about an API.

Back to top

Response

If successful, this operation returns HTTP status code 200, with the complete updated API object.

Back to top

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"
}

Sample response body: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<API xmlns="http://soa.com/xsd/api/1.0" xmlns:ns2="http://soa.com/xsd/business/1.0" xmlns:ns3="http://soa.com/xsd/resource/1.0" 
xmlns:ns4="http://soa.com/xsd/legals/1.0" xmlns:ns5="http://soa.com/xsd/dnmodel/1.0">
  <APIID>8bebe599-3b97-45bc-a6a7-73542af275a7.acmepaymentscorp</APIID>
  <Name>2</Name>
  <Description>My API Description</Description>
  <Visibility>Public</Visibility>
  <LatestVersionID>702bdb10-a1ff-45fe-8a84-943b81e4563d.acmepaymentscorp</LatestVersionID>
  <IsFollowed>false</IsFollowed>
  <ns3:RatingSummary>
    <ns3:Five>0</ns3:Five>
    <ns3:Four>0</ns3:Four>
    <ns3:Three>0</ns3:Three>
    <ns3:Two>0</ns3:Two>
    <ns3:One>0</ns3:One>
  </ns3:RatingSummary>
  <APIVersion>
    <APIVersionID>73968906-c9e7-4dbd-82c8-e79442affcc1.acmepaymentscorp</APIVersionID>
    <APIID>8bebe599-3b97-45bc-a6a7-73542af275a7.acmepaymentscorp</APIID>
    <Name>6</Name>
    <Description>6</Description>
    <Type>shttp</Type>
    <DefaultProfile>Any in and out</DefaultProfile>
    <SandboxEndpoint>http://my-proxy-api-cname:9901/</SandboxEndpoint>
    <Operations>
      <Operation>
        <Name>Default_Operation</Name>
        <Method>GET</Method>
        <Path>/{path:.+|}</Path>
        <InputContentType>*/*</InputContentType>
        <OutputContentType>*/*</OutputContentType>
        <FaultContentType>*/*</FaultContentType>
        <Input>
          <Name>path</Name>
          <Type>path</Type>
        </Input>
      </Operation>
    </Operations>
    <Endpoints>
      <Endpoint>
        <Category>Sandbox</Category>
        <Uri>http://my-proxy-api-cname:9901/</Uri>
        <CName>my-proxy-api-cname</CName>
        <DeploymentZoneRule>1b16623b-1609-4664-9900-06f8441bdefault-http0</DeploymentZoneRule>
      </Endpoint>
    </Endpoints>
    <Policies />
    <TargetAPI>
      <Type>shttp</Type>
      <DefaultProfile>Any in and out</DefaultProfile>
      <Endpoints>
        <Endpoint>
          <Category>Sandbox</Category>
          <Uri>http://www.mytargeturl.com</Uri>
        </Endpoint>
      </Endpoints>
      <Operations>
        <Operation>
          <Name>Default_Operation</Name>
          <Method>GET</Method>
          <Path>/{path:.+|}</Path>
          <InputContentType>*/*</InputContentType>
          <OutputContentType>*/*</OutputContentType>
          <FaultContentType>*/*</FaultContentType>
          <Input>
            <Name>path</Name>
            <Type>path</Type>
          </Input>
        </Operation>
      </Operations>
      <Policies />
    </TargetAPI>
    <Visibility>Public</Visibility>
    <State>com.soa.api.state.open</State>
    <ProductionEndpointAccessAutoApproved>true</ProductionEndpointAccessAutoApproved>
    <SandboxEndpointAccessAutoApproved>true</SandboxEndpointAccessAutoApproved>
    <SandboxAnonymousAccessAllowed>false</SandboxAnonymousAccessAllowed>
    <ProductionAnonymousAccessAllowed>false</ProductionAnonymousAccessAllowed>
    <ResourceLevelPermissionsSupported>false</ResourceLevelPermissionsSupported>
  </APIVersion>
  <AdminGroupID>apiadmin-8bebe599-3b97-45bc-a6a7-73542af275a7.acmepaymentscorp</AdminGroupID>
  <Created>2014-07-03T18:42:12Z</Created>
  <Updated>2014-07-03T18:46:28Z</Updated>
  <AvatarURL>http://{hostname}/api/apis/8bebe599-3b97-45bc-a6a7-73542af275a7.acmepaymentscorp/avatar</AvatarURL>
</API>

Back to top

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

Back to top

Response Body

Name Type Description
API API Includes information about an API. The full updated API information is returned.

Back to top

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.

Back to top

Related Topics