PUT /api/apis/versions/{APIVersionID}/resources

Adds or updates information about operation-specific scope mapping for an API version.

Authorization Roles/Permissions: Must have permission to modify the API; an API Admin or Business Admin.

Metadata indexing: When this operation is run successfully, the platform metadata is automatically reindexed. Since the API documentation might include a metadata.xml file that directs visibility, the index must be updated when the API documentation resources are updated, to ensure the correct API documentation visibility settings are implemented.

This topic includes the following sections:

HTTP Method

PUT

Back to top

URL

https://{hostname}/api/apis/versions/{APIVersionID}/resources

Back to top

Sample Request

The example below sends the values for the operation-specific scope mapping for the specified API version.

Request URL

https://{hostname}/api/apis/versions/650346bb-4f4d-41ff-b38a-ca727b91181f.acmepaymentscorp/resources

Sample request headers

PUT /api/apis/versions/650346bb-4f4d-41ff-b38a-ca727b91181f.acmepaymentscorp/resources HTTP/1.1
Host: {hostname}
Accept: application/json, text/javascript, */*; q=0.01
Content-Type: application/json; charset=UTF-8
X-Csrf-Token_{tenant}: {TokenID}

Sample request body (operation-specific scope mapping in use)

{
  "OperationResource":[
    {
      "OperationName":"listPayments",
      "ResourceID":[
        "289f692f-66d5-43bb-b7ed-51e0bfd0aef9.acmepaymentscorp"
      ]
    },
    {
      "OperationName":"getPayment",
      "ResourceID":[
        "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp",
        "148e2bcf-4d9b-463d-9da7-b12112722049.acmepaymentscorp"
      ]
    },
    {
      "OperationName":"addPayment",
      "ResourceID":[
        "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp"
      ]
    },
    {
      "OperationName":"modifyPayment",
      "ResourceID":[
        "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp"
      ]
    },
    {
      "OperationName":"deletePayment",
      "ResourceID":[
        "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp"
      ]
    }
  ]
}

Sample request body (operation-specific scope mapping not in use)

{
  "ResourceID":[

  ]
}

Back to top

Request Headers

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

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

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

application/json, application/vnd.soa.v71+json, application/vnd.soa.v72+json, application/vnd.soa.v80+json, application/vnd.soa.v81+json

X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform.

Back to top

Request Parameters

Parameter Parm Type Data Type Required Description
APIVersionID Path string Required The unique ID for a specific API version.
APIVersionResources Body APIVersionResources Required

Contains information about scope mapping values for a specific API version.

OperationName and ResourceID are required.

Back to top

Response

If successful, this operation returns HTTP status code 200, with information about the operation-specific scope mapping for the specified API version.

Back to top

Sample Response

The sample response below shows successful completion of this operation. There are five operations; four operations are mapped to one scope each, and one operation is mapped to three scopes.

Sample response headers

HTTP/1.1 200 OK
Content-Type: application/json
Expires: Thu, 19 Jun 2014 15:46:22 GMT

Sample response body (operation-specific scope mapping in use)

{
  "OperationResourceDetails" : [ {
    "OperationName" : "addPayment",
    "Resource" : [ {
      "ResourceID" : "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp",
      "Name" : "FullScope",
      "ShortDescription" : "Full access to all operations.",
      "LongDescription" : "Full access to all operations.",
      "Visibility" : "Public",
      "SandboxAnonymousAccessAllowed" : false,
      "ProductionAnonymousAccessAllowed" : false,
      "ResourcePath" : "",
      "OAuthGrantDefaultResource" : true,
      "OAuthGrantUserAuthorizationRequired" : true,
      "BusinessID" : "tenantbusiness.acmepaymentscorp"
    } ]
  }, {
    "OperationName" : "deletePayment",
    "Resource" : [ {
      "ResourceID" : "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp",
      "Name" : "FullScope",
      "ShortDescription" : "Full access to all operations.",
      "LongDescription" : "Full access to all operations.",
      "Visibility" : "Public",
      "SandboxAnonymousAccessAllowed" : false,
      "ProductionAnonymousAccessAllowed" : false,
      "ResourcePath" : "",
      "OAuthGrantDefaultResource" : true,
      "OAuthGrantUserAuthorizationRequired" : true,
      "BusinessID" : "tenantbusiness.acmepaymentscorp"
    } ]
  }, {
    "OperationName" : "getPayment",
    "Resource" : [ {
      "ResourceID" : "148e2bcf-4d9b-463d-9da7-b12112722049.acmepaymentscorp",
      "Name" : "ReadOnlyScope",
      "ShortDescription" : "Read-only operations.",
      "LongDescription" : "Read-only operations. Public visibility",
      "Visibility" : "Public",
      "SandboxAnonymousAccessAllowed" : false,
      "ProductionAnonymousAccessAllowed" : false,
      "ResourcePath" : "",
      "OAuthGrantDefaultResource" : true,
      "OAuthGrantUserAuthorizationRequired" : true,
      "BusinessID" : "tenantbusiness.acmepaymentscorp"
    }, {
      "ResourceID" : "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp",
      "Name" : "FullScope",
      "ShortDescription" : "Full access to all operations.",
      "LongDescription" : "Full access to all operations.",
      "Visibility" : "Public",
      "SandboxAnonymousAccessAllowed" : false,
      "ProductionAnonymousAccessAllowed" : false,
      "ResourcePath" : "",
      "OAuthGrantDefaultResource" : true,
      "OAuthGrantUserAuthorizationRequired" : true,
      "BusinessID" : "tenantbusiness.acmepaymentscorp"
    } ]
  }, {
    "OperationName" : "listPayments",
    "Resource" : [ {
      "ResourceID" : "289f692f-66d5-43bb-b7ed-51e0bfd0aef9.acmepaymentscorp",
      "Name" : "BetaScope",
      "ShortDescription" : "Access to beta operations.",
      "LongDescription" : "Access to beta operations for testing (private)",
      "Visibility" : "Limited",
      "SandboxAnonymousAccessAllowed" : false,
      "ProductionAnonymousAccessAllowed" : false,
      "ResourcePath" : "",
      "OAuthGrantDefaultResource" : true,
      "OAuthGrantUserAuthorizationRequired" : true,
      "BusinessID" : "tenantbusiness.acmepaymentscorp"
    } ]
  }, {
    "OperationName" : "modifyPayment",
    "Resource" : [ {
      "ResourceID" : "db006ad1-2101-45c0-9cbe-c40fa1a0d2ca.acmepaymentscorp",
      "Name" : "FullScope",
      "ShortDescription" : "Full access to all operations.",
      "LongDescription" : "Full access to all operations.",
      "Visibility" : "Public",
      "SandboxAnonymousAccessAllowed" : false,
      "ProductionAnonymousAccessAllowed" : false,
      "ResourcePath" : "",
      "OAuthGrantDefaultResource" : true,
      "OAuthGrantUserAuthorizationRequired" : true,
      "BusinessID" : "tenantbusiness.acmepaymentscorp"
    } ]
  } ]
}

Sample response body (operation-specific scope mapping not in use)

{
}

Back to top

Response Headers

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

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

Back to top

Response Body

Name Type Description
APIVersionResourceDetails APIVersionResourceDetails Contains details about operation-specific scope mapping for an API version, if operation-specific scope mapping is in use for the API version.

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.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.

Back to top

Related Topics