PUT /api/apis/versions/{ApiVersionID}/implementations/{ImplCode}/target-policies

Valid in Version: 2020.2.0 and later

Modifies the policy assignments for the specified implementation for the specified API version.

Authorization Roles/Permissions: Must be logged in and have permission to view the requested resources. If the user is logged in but doesn't have permission to view certain resources, the operation works, but limited (or empty) results are returned.

This topic includes the following sections:

HTTP Method

PUT

URL

https://{hostname}/api/apis/versions/{ApiVersionID}/implementations/{ImplCode}/target-policies

Sample Request

The example below shows a request to modify the policy information for the specified implementation.

Sample Request URL

https://{hostname}/api/apis/versions/d7c7104f-8341-4da6-a45f-47114b4d3d7d.acmepaymentscorp/implementations/live/target-policies

Sample request headers

Content-Type: application/json
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

{
  "Policy":[
    {
      "PolicyKey":"acmepaymentscorp-AtmosphereApplicationSecurityPolicy",
      "Name":"AtmosphereApplicationSecurityPolicy",
      "Description":"",
      "PolicyType":"Operational Policy",
      "PolicySubType":"policy.apisec"
    }
  ],
  "ApiOperationPolicy":[
    {
      "Operation":{
        "Name":"addPet",
        "Method":"POST",
        "Path":"/pet",
        "InputContentType":"application/xml,application/json",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"body",
            "Type":"entity"
          }
        ],
        "OperationKey":"97903530-b198-4042-9f13-5edaca282f30",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"addPet"
      },
      "Policy":[
        {
          "PolicyKey":"acmepaymentscorp-DetailedAuditing",
          "Name":"DetailedAuditing",
          "Description":"",
          "PolicyType":"Operational Policy",
          "PolicySubType":"policy.auditservice"
        }
      ]
    },
    {
      "Operation":{
        "Name":"deletePet",
        "Method":"DELETE",
        "Path":"/pet/{petId}",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"api_key",
            "Type":"header"
          },
          {
            "Name":"petId",
            "Type":"path"
          }
        ],
        "OperationKey":"fff49ad9-c8f7-4c00-b6f6-69e5ae2b354a",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"deletePet"
      }
    },
    {
      "Operation":{
        "Name":"findPetsByStatus",
        "Method":"GET",
        "Path":"/pet/findByStatus",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"status",
            "Type":"query"
          }
        ],
        "OperationKey":"bc3c5451-edc4-49e0-b2f1-ee6b65e39b38",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"findPetsByStatus"
      }
    },
    {
      "Operation":{
        "Name":"findPetsByTags",
        "Method":"GET",
        "Path":"/pet/findByTags",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"tags",
            "Type":"query"
          }
        ],
        "OperationKey":"217d9597-ce9c-4837-8b78-fa6ea6c54ba4",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"findPetsByTags"
      }
    },
    {
      "Operation":{
        "Name":"getPetById",
        "Method":"GET",
        "Path":"/pet/{petId}",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"petId",
            "Type":"path"
          }
        ],
        "OperationKey":"de910201-4dbc-4396-bcce-90883f12d51a",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"getPetById"
      }
    }
  ]
}

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/json, application/vnd.soa.v81+json
Content-Type

Any one of the following media types is valid for the request Content-Type:

application/json or application/vnd.soa.v81+json

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
APIVersionID Path string Required The unique ID for a specific API version.
ImplCode Path string Required A code for a specific implementation. Valid values: Live or Sandbox.
IncludeImpliedPolicies Path Boolean Optional

If set to true, implied policies are also included in the response. These are policies that are assigned to ancestors. For example, policies assigned to the platform tenant will apply to all services. If this parameter is set to true, all policies assigned to services, including inherited policy assignments, are returned.

Default: false.

ApiPolicies Body ApiPolicies Required Contains information about the policies assigned to an API, at the API level or at the operation level.

Response

If successful, this operation returns HTTP status code 200, with the updated implementation policy information.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers

Content-Type: application/json
Date: Wed, 11 Nov 2020 21:33:37 GMT

Sample response body

{
  "Policy":[
    {
      "PolicyKey":"acmepaymentscorp-AtmosphereApplicationSecurityPolicy",
      "Name":"AtmosphereApplicationSecurityPolicy",
      "Description":"",
      "PolicyType":"Operational Policy",
      "PolicySubType":"policy.apisec"
    }
  ],
  "ApiOperationPolicy":[
    {
      "Operation":{
        "Name":"addPet",
        "Method":"POST",
        "Path":"/pet",
        "InputContentType":"application/xml,application/json",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"body",
            "Type":"entity"
          }
        ],
        "OperationKey":"97903530-b198-4042-9f13-5edaca282f30",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"addPet"
      },
      "Policy":[
        {
          "PolicyKey":"acmepaymentscorp-DetailedAuditing",
          "Name":"DetailedAuditing",
          "Description":"",
          "PolicyType":"Operational Policy",
          "PolicySubType":"policy.auditservice"
        }
      ]
    },
    {
      "Operation":{
        "Name":"deletePet",
        "Method":"DELETE",
        "Path":"/pet/{petId}",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"api_key",
            "Type":"header"
          },
          {
            "Name":"petId",
            "Type":"path"
          }
        ],
        "OperationKey":"fff49ad9-c8f7-4c00-b6f6-69e5ae2b354a",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"deletePet"
      }
    },
    {
      "Operation":{
        "Name":"findPetsByStatus",
        "Method":"GET",
        "Path":"/pet/findByStatus",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"status",
            "Type":"query"
          }
        ],
        "OperationKey":"bc3c5451-edc4-49e0-b2f1-ee6b65e39b38",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"findPetsByStatus"
      }
    },
    {
      "Operation":{
        "Name":"findPetsByTags",
        "Method":"GET",
        "Path":"/pet/findByTags",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"tags",
            "Type":"query"
          }
        ],
        "OperationKey":"217d9597-ce9c-4837-8b78-fa6ea6c54ba4",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"findPetsByTags"
      }
    },
    {
      "Operation":{
        "Name":"getPetById",
        "Method":"GET",
        "Path":"/pet/{petId}",
        "InputContentType":"",
        "OutputContentType":"application/xml,application/json",
        "FaultContentType":"",
        "Input":[
          {
            "Name":"petId",
            "Type":"path"
          }
        ],
        "OperationKey":"de910201-4dbc-4396-bcce-90883f12d51a",
        "InterfaceQName":"{Swagger_Petstore_5_Operations_v1}Swagger_Petstore_5_Operations_PortType_0",
        "WsdlOperationName":"getPetById"
      }
    }
  ]
}

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/json, application/vnd.soa.v81+json

Response Body

Name Type Description
ApiPolicies ApiPolicies Contains information about the policies assigned to an API, at the API level or at the operation level.

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.