Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Parse Classifications

POST/api/v2/admin/markings/parseClassifications

Parses classification marking strings (e.g. MTS//MNF) into their component marking IDs. Strings that cannot be parsed are returned in errors with a human-readable message.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:admin-read.

Request body

ParseClassificationsRequest
object
Hide child attributes

Hide child attributes

classificationStrings
list<string>optional

The classification strings to parse, e.g. MTS//MNF. Requests must contain between 1 and 1000 entries. Duplicate entries count toward this limit but are parsed only once. An empty list returns a MissingBatchRequest error, and more than 1000 entries returns a BatchRequestSizeExceededLimit error.

Response body

ParseClassificationsResponse
object
Hide child attributes

Hide child attributes

parsed
map<string, array>optional

Map of valid classification strings to their component marking IDs. Strings that could not be parsed are absent from this map and appear in 'errors' instead.

Show child attributes

Show child attributes

errors
map<string, string>optional

Map of classification strings that could not be parsed to a human-readable error message.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ \t-H "Content-type: application/json" \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/admin/markings/parseClassifications" \ -d '{"classificationStrings":["MTS//MNF","INVALID_MARKING"]}'

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 { "parsed": { "MTS//MNF": [ "MNF", "MTS" ] }, "errors": { "INVALID_MARKING": "Unknown marking: INVALID_MARKING" } }

Error responses

Error Name
ParseClassificationsPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe provided token does not have permission to parse the given classification strings.
ParametersclassificationStrings
CbacUnavailableError CodeINVALID_ARGUMENT
Status Code400
DescriptionCBAC is not available.
Parameters
MissingBatchRequestError CodeINVALID_ARGUMENT
Status Code400
DescriptionBatch requests must contain at least one element.
Parameters
BatchRequestSizeExceededLimitError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe submitted batch request was too large.
ParametersmaximumBatchSize, providedBatchSize