Ana içeriğe geç

Get Global Policy

Endpoint

GET /apiops/projects/{projectName}/globalPolicies/{policyName}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
policyNamestringYesGlobal policy name (the policy must already exist)

Query Parameters

None

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"resultList": [
{
"id": "665f2a1c9b3e4a0012ab34ce",
"name": "backend-ws-security",
"policyType": "policy-ws-security-username",
"policyTypeLabel": "policy-ws-security-username"
}
],
"resultCount": 1
}

Response Fields

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
resultListarraySingle-element list containing the global policy descriptor
resultCountintegerAlways 1 on success

Global Policy Descriptor Fields

FieldTypeDescription
idstringInternal policy ID
namestringGlobal policy name
policyTypestringThe _class discriminator of the policy (e.g. oidc-auth)
policyTypeLabelstringDisplay label for the policy type. In the current implementation this is identical to policyType

EnumStatus

  • SUCCESS - Operation successful
  • FAILURE - Operation failed

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Global policy (name: backend-ws-security) was not found!"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/globalPolicies/backend-ws-security/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Lightweight Response: Only id, name, policyType and policyTypeLabel are returned. The full policy body — including any @SecretData fields — is never returned by this endpoint, not even masked.
  • policy-group Excluded: This endpoint never matches a policy group, even if one happens to share the requested name in another collection. Use Get Policy Group for policy groups.
  • Case-Insensitive Match: policyName is matched case-insensitively against the stored name.
  • Not Found: Requesting a name that does not exist returns a 400 Bad Request with a FAILURE status, not 404.
  • Permission: Requires API_MANAGEMENT + VIEW in the project.