{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":738,"path":"api-reference/server-api-reference/DCManagerAPIGlobal.md","title":"DCManager - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# DCManager- Global\n\nThe DCManager API enables you to group data by type.\n\nUsing this API you can:\n\n-   Assign data classifications to existing dictionary entries.\n-   Look up the data classifications for specific dictionary entries.\n-   Remove all data classifications associated with specific dictionary entries.\n-   Retrieve a list of all data classifications available in the current domain.\n\nThis API requires the Data Classification \\[com.glide.data\\_classification\\] plugin.\n\nFor more information, see [Data Classification](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/data-classification.md).\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## DCManager - classify\\(String dictEntries, String dataClasses\\)\n\nAssigns pre-defined or user-defined data classifications to existing dictionary entries.\n\nRequires the admin or data\\_classification\\_admin role.\n\n<table id=\"table_wkc_j5c_snb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndictEntries\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_ids of the records you want to classify. Entered as a comma-separated list enclosed in a string.\n\nTable: Dictionary \\[sys\\_dictionary\\] table\n\n</td></tr><tr><td>\n\ndataClasses\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_ids of the data classifications you want to assign. Entered as a comma-separated list enclosed in a string.\n\nTable: Data Classification \\[data\\_classification\\]\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|String|Message describing the result of the operation.|\n\nThis example finds records containing social security numbers and classifies the records as confidential.\n\n```\nvar dcm = new SNC.DCManager();\nvar confidentialClass = {};\nvar ssnFields = [];\nvar dataClasses = JSON.parse(dcm.getAllDataClasses());\n\n// Get the Confidential data class record\ndataClasses.forEach(function (dataClass) {\n  if (dataClass.name == \"Confidential\")\n    confidentialClass = dataClass;\n});\n\n// Find fields that seem to be strong social security numbers\nvar dictionaryGR = new GlideRecord(\"sys_dictionary\");\ndictionaryGR.addQuery(\"element\", \"ssn\").addOrCondition(\"element\", \"social_security_number\");\ndictionaryGR.query();\nwhile (dictionaryGR.next())\n  ssnFields.push(dictionaryGR.getUniqueValue());\n\n// Classify any found entries as Confidential\nif (ssnFields.length > 0)\n  dcm.classify(ssnFields.join(), confidentialClass.sys_id);\n\n```\n\nOutput:\n\n```\n\"Successfully stored the data classification configurations\"\n```\n\n## DCManager - clearClassification\\(String dictEntries\\)\n\nRemoves all data classifications for the specified dictionary entries.\n\nRequires the admin or data\\_classification\\_admin role.\n\n<table id=\"table_jls_l5c_snb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndictEntries\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_ids of the records you want to remove classifications from. Entered as a comma-separated list enclosed in a string.\n\nTable: Dictionary \\[sys\\_dictionary\\]\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|String|Message describing the result of the operation.|\n\nThis example removes the data classification for a dictionary entry.\n\n```\nvar dcm = new SNC.DCManager();\ngs.info(dcm.clearClassification(\"445de0a6dba30300efc57416bf9619b0\"));\n\n```\n\nOutput:\n\n```\n\"Classifications removed for the specified dictionary entries\"\n```\n\n## DCManager - getAllDataClasses\\(\\)\n\nReturns a list of all data classifications available in the current domain.\n\nRequires the admin, data\\_classification\\_admin, or data\\_classification\\_auditor role.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_ryt_m5c_snb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n&lt;Array&gt;\n\n</td><td>\n\nResult of the request. Returns the sys\\_id and name for each available data classification. If there are no data classifications, it returns an empty array.\n\n Data classifications can be organized into parent-child relationships. If there are parent data classifications, they are identified in the result.\n\n Data type: Array\n\n ```\n[\n  {\n    \"parent\": {Object},\n    \"sys_id\": \"String\",\n    \"name\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.parent\n\n</td><td>\n\nEntry for a parent data classification.Data type: Object\n\n ```\n\"parent\": {\n  \"sys_id\": \"String\",\n  \"name\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.parent.sys\\_id\n\n</td><td>\n\nSys\\_id of the parent data classification from the Data Classification \\[data\\_classification\\] table.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.parent.name\n\n</td><td>\n\nName of the parent data classification.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.sys\\_id\n\n</td><td>\n\nSys\\_id of the data classification from the Data Classification \\[data\\_classification\\] table.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.name\n\n</td><td>\n\nName of the data classification.Data type: String\n\n</td></tr></tbody>\n</table>This example retrieves a list of all available data classifications.\n\n```\nvar dcm = new SNC.DCManager();\ngs.info(dcm.getAllDataClasses());\n\n```\n\nOutput:\n\n```\n[\n  {\n    \"parent\": {\n      \"sys_id\": \"a9670fc773fc1010ae8dd21efaf6a735\",\n      \"name\": \"Confidential\"\n    },\n    \"sys_id\": \"348107b951d71010f877f3f178e7dd0d\",\n    \"name\": \"Personally identifiable information\"\n  },\n  {\n    \"sys_id\": \"a9670fc773fc1010ae8dd21efaf6a735\",\n    \"name\": \"Confidential\"\n  },\n  {\n    \"sys_id\": \"59b7070b73fc1010ae8dd21efaf6a764\",\n    \"name\": \"Restricted\"\n  },\n  {\n    \"sys_id\": \"11d60fc773fc1010ae8dd21efaf6a744\",\n    \"name\": \"Internal\"\n  },\n  {\n    \"sys_id\": \"f5b4cf4773fc1010ae8dd21efaf6a766\",\n    \"name\": \"Public\"\n  }\n]\n```\n\n## DCManager - getClassification\\(String dictEntries\\)\n\nRetrieves all data classifications for the specified dictionary entries.\n\n<table id=\"table_mfh_k5c_snb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ndictEntries\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_ids of the records you want to retrieve classifications for. Entered as a comma-separated list enclosed in a string.\n\nTable: Dictionary \\[sys\\_dictionary\\]\n\n</td></tr></tbody>\n</table><table id=\"table_nfh_k5c_snb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n&lt;Object&gt;\n\n</td><td>\n\nJSON object containing each dictionary entry's sys\\_id with an array of its associated data classes. If there are no associated data classifications, it returns a message describing the result of the operation.\n\n Data classifications can be organized into parent-child relationships. If there are parent data classifications, they are identified in the result.\n\n Data type: Object\n\n ```\n{\n  <sys_dictionary_sys_id>: [\n    {\n      \"parent\": {Object},\n      \"sys_id\": \"String\",\n      \"name\": \"String\"\n    }\n  ]\n}\n\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.parent\n\n</td><td>\n\nEntry for a parent data classification.Data type: Object\n\n```\n\"parent\": {\n  \"sys_id\": \"String\",\n  \"name\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.parent.sys\\_id\n\n</td><td>\n\nSys\\_id of the parent data classification from the Data Classification \\[data\\_classification\\] table.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.parent.name\n\n</td><td>\n\nName of the parent data classification.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.sys\\_id\n\n</td><td>\n\nSys\\_id of the data classification from the Data Classification \\[data\\_classification\\] table.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.name\n\n</td><td>\n\nName of the data classification.Data type: String\n\n</td></tr></tbody>\n</table>This example retrieves the data classifications for a dictionary entry.\n\n```\nvar dcm = new SNC.DCManager();\ngs.info(dcm.getClassification(\"445de0a6dba30300efc57416bf9619b0\"));\n\n```\n\nOutput:\n\n```\n{\n  \"445de0a6dba30300efc57416bf9619b0\": [\n    {\n      \"parent\": {\n        \"sys_id\": \"a9670fc773fc1010ae8dd21efaf6a735\",\n        \"name\": \"Confidential\"\n      },\n      \"sys_id\": \"348107b951d71010f877f3f178e7dd0d\",\n      \"name\": \"Personally identifiable information\"\n    }\n  ]\n}\n```\n\n"}}