{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":898,"path":"api-reference/server-api-reference/SCIM2ClientAPI.md","title":"SCIM2Client - Scoped","bundle":null,"doc_type":null,"release":"australia","body":"\n# SCIM2Client- Scoped\n\nThe SCIM2Client API provides methods that call the System for Cross-domain Identity Management \\(SCIM\\) Provider \\(server role\\) to create, update, or delete data in a service provider \\(SP\\).\n\nSCIM is a REST and JSON-based protocol that defines a client and server role. A client is usually an identity provider \\(IDP\\), such Okta, that contains a robust directory of user identities. An SP is typically a SaaS application, such as Box or Slack, that needs a subset of information from those identities. When changes to identities are made in the IDP, including create, update, and delete, they are automatically synchronized to the SP according to the SCIM protocol.\n\nThe following image illustrates typical API call flows for manipulating service provider data.\n\n\\[Omitted image \"SCIMClient\\_call\\_flow.png\"\\] Alt text: SCMI Client API call flow\n\nThis API runs in the `sn_auth` namespace and requires the SCIM v2 - ServiceNow Cross-domain Identity Management Client \\(com.snc.integration.scim2.client\\) plugin to be installed to access the API.\n\nYou can locate the results of each SCIM method call in the SCIM Client Logs \\[sys\\_scim\\_client\\_logs\\] table.\n\nFor additional information on SCIM, see [System for Cross-domain Identity Management \\(SCIM\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/scim.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## SCIM2Client - executeDelete \\(String provider, String resourceName, String providerResourceId\\)\n\nDeletes a specified resource from an external service provider system.\n\n<table id=\"table_yhc_r5k_btb\" 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\nprovider\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the configured SCIM service provider. The service provider name is defined in the name field of the SCIM Provider \\[sys\\_scim\\_provider\\] table.\n\n</td></tr><tr><td>\n\nresourceName\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the resource type, such as User or Group.Table: In the resource\\_name field of the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping\\] table.\n\n</td></tr><tr><td>\n\nproviderResourceId\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Unique identifier of the associated resource on the external service provider system.\n\n</td></tr></tbody>\n</table><table id=\"id_hqb_vfl_btb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nIf the **status** is SUCCESS, the endpoint returns the response body as defined by the REST [SCIM](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/scim-api.md) API.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the request.Possible values:\n\n-   FAILURE\n-   SUCCESS\n\nData type: String\n\n</td></tr></tbody>\n</table>The following example shows how to delete a user resource in the SNOW Provider system.\n\n```\nvar scimClient = new sn_auth.SCIM2Client(); \nvar response = scimClient.executeDelete('SNOW Provider','User','f282abf03710200044e0bfc8bcbe5d12'); \ngs.info('response: ' + response);\n```\n\nOutput:\n\n```\n// Example of a successful response\n{\n  \"status\":\"SUCCESS\",\n  \"message\":null\n}\n\n// Example of a failed response\n{\n  \"status\":\"FAILURE\",\n  \"message\":\"{\n    \\\"schemas\\\":[\n      \\\"urn:ietf:params:scim:api:messages:2.0:Error\\\"\n    ],\n    \\\"status\\\":\\\"404\\\",\n    \\\"detail\\\":\\\"Invalid user id 3985e598876989103fa711f83cbb35ae1\\\"\n  }\"\n}\n```\n\n## SCIM2Client - executeGet \\(String provider, String resourceName, String queryParams\\)\n\nReturns all resources from a specified external provider system that match the passed criteria.\n\nThis information is used to call the corresponding SCIM service provider API.\n\n<table id=\"table_smr_cpk_btb\" 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\nprovider\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the configured SCIM service provider. The service provider name is defined in the name field of the SCIM Provider \\[sys\\_scim\\_provider\\] table.\n\n</td></tr><tr><td>\n\nresourceName\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the resource type, such as User or Group.Table: In the resource\\_name field of the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping\\] table.\n\n</td></tr><tr><td>\n\nqueryParams\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. SCIM compliant query parameters passed to the external SCIM service provider endpoint.For additional information on the available query parameters and their associated format, refer to the following sections in the Internet Engineering Task Force document: System for Cross-domain Identity Management: Protocol\n\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.2](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.2)\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.4](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.4)\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.3](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.3)\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.5](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.5)\n\n</td></tr></tbody>\n</table><table id=\"id_orm_vrt_ctb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nIf the **status** is SUCCESS, the endpoint returns the response body as defined by the REST [SCIM](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/scim-api.md) API.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the request.Possible values:\n\n-   FAILURE\n-   SUCCESS\n\nData type: String\n\n</td></tr></tbody>\n</table>The following example shows how to retrieve all of the available users from the snow test service provider whose work email contains lucius.bagnoli.\n\n```\nvar scimClient = new sn_auth.SCIM2Client(); \nvar queryParams = {}; \nqueryParams['filter'] = 'emails[type eq \\\"work\\\" and value co \\\"lucius.bagnoli\\\"]'; \nvar response = scimClient.executeGet('SCIM Provider Demo','User', queryParams); \ngs.info('response for get with filter: ' + response);\n```\n\nResponse:\n\n```\n//Example of a successful response\n{\n  \"status\":\"SUCCESS\",\n  \"message\":\"{\n    \\\"schemas\\\":[\n      \\\"urn:ietf:params:scim:api:messages:2.0:ListResponse\\\"\n    ],\n  \\\"totalResults\\\":647,\n  \\\"Resources\\\":[\n    {\n      \\\"schemas\\\":[\n        \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\",\n        \\\"urn:ietf:params:scim:schemas:core:2.0:User\\\"\n      ],\n    \\\"id\\\":\\\"005d500b536073005e0addeeff7b12f4\\\",\n    \\\"meta\\\":{\n      \\\"resourceType\\\":\\\"User\\\",\n      \\\"created\\\":\\\"2019-04-05T21:09:12Z\\\",\n      \\\"lastModified\\\":\\\"2021-10-10T19:38:36Z\\\",\n      \\\"location\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Users/005d500b536073005e0addeeff7b12f4\\\"\n    },\n    \\\"userName\\\":\\\"survey.user\\\",\n    \\\"name\\\":{\n      \\\"familyName\\\":\\\"user\\\",\n      \\\"givenName\\\":\\\"survey\\\"\n    },\n    \\\"displayName\\\":\\\"survey user\\\",\n    \\\"active\\\":true,\n    \\\"emails\\\":[\n      {\n        \\\"value\\\":\\\"survey.user@email.com\\\",\n        \\\"type\\\":\\\"work\\\"\n      }\n    ]\n  },\n  {\n    \\\"schemas\\\":[\n      \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\",\n      \\\"urn:ietf:params:scim:schemas:core:2.0:User\\\"\n    ],\n    \\\"id\\\":\\\"02826bf03710200044e0bfc8bcbe5d3f\\\",\n    \\\"meta\\\":{\n      \\\"resourceType\\\":\\\"User\\\",\n      \\\"created\\\":\\\"2012-02-18T03:04:49Z\\\",\n      \\\"lastModified\\\":\\\"2021-10-10T19:38:36Z\\\",\n      \\\"location\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Users/02826bf03710200044e0bfc8bcbe5d3f\\\"\n    },\n    \\\"userName\\\":\\\"lucius.bagnoli\\\",\n    \\\"name\\\":{\n      \\\"familyName\\\":\\\"Bagnoli\\\",\n      \\\"givenName\\\":\\\"Lucius\\\"\n    },\n    \\\"displayName\\\":\\\"Lucius Bagnoli\\\",\n    \\\"active\\\":true,\n    \\\"emails\\\":[\n      {\n        \\\"value\\\":\\\"lucius.bagnoli@example.com\\\",\n        \\\"type\\\":\\\"work\\\"\n      }\n    ],\n    \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\":{\n      \\\"gender\\\":\\\"Male\\\",\n      \\\"costCenter\\\":{\n        \\\"value\\\":\\\"91e8bbf43710200044e0bfc8bcbe5daa\\\",\n        \\\"name\\\":\\\"Customer Support\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/CostCenters/91e8bbf43710200044e0bfc8bcbe5daa\\\"\n      },\n      \\\"company\\\":{\n        \\\"value\\\":\\\"81fd65ecac1d55eb42a426568fc87a63\\\",\n        \\\"name\\\":\\\"ACME Japan\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63\\\"\n      },\n      \\\"department\\\":{\n        \\\"value\\\":\\\"5d7f17f03710200044e0bfc8bcbe5d43\\\",\n        \\\"name\\\":\\\"Customer Support\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Departments/5d7f17f03710200044e0bfc8bcbe5d43\\\"\n      },\n      \\\"manager\\\":{\n        \\\"value\\\":\\\"02826bf03710200044e0bfc8bcbe5d88\\\",\n        \\\"displayName\\\":\\\"Billie Cowley\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Users/02826bf03710200044e0bfc8bcbe5d88\\\"\n      },\n      \\\"location\\\":{\n        \\\"value\\\":\\\"0002c0a93790200044e0bfc8bcbe5df5\\\",\n        \\\"name\\\":\\\"2-10-1 Yurakucho, Chiyoda-ku, Tokyo\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Locations/0002c0a93790200044e0bfc8bcbe5df5\\\"\n      }\n    }\n  }\n],\n\\\"startIndex\\\":1,\n\\\"itemsPerPage\\\":2}\"}\n\n\n// Example of a failure response\n{\n  \"status\":\"FAILURE\",\n  \"message\":\"SCIM Provider rest message is not configured properly\"\n}\n```\n\n## SCIM2Client - executeGetById \\(String provider, String resourceName, String providerResourceId, Map&lt;String, String&gt; queryParams\\)\n\nReturns a resource from the external provider system with the specified unique resource ID.\n\nThis information is used to call the corresponding SCIM service provider API.\n\n<table id=\"id_xsc_lmk_btb\" 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\nprovider\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the configured SCIM service provider. The service provider name is defined in the name field of the SCIM Provider \\[sys\\_scim\\_provider\\] table.\n\n</td></tr><tr><td>\n\nproviderResourceId\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Unique identifier of the associated resource on the external service provider system.\n\n</td></tr><tr><td>\n\nqueryParams\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. SCIM compliant query parameters passed to the external SCIM service provider endpoint.For additional information on the available query parameters and their associated format, refer to the following sections in the Internet Engineering Task Force document: System for Cross-domain Identity Management: Protocol\n\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.2](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.2)\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.4](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.4)\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.3](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.3)\n-   [https://datatracker.ietf.org/doc/html/rfc7644\\#section-3.4.2.5](https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2.5)\n\n</td></tr></tbody>\n</table><table id=\"id_sz2_wrt_ctb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nIf the **status** is SUCCESS, the endpoint returns the response body as defined by the REST [SCIM](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/scim-api.md) API.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the request.Possible values:\n\n-   FAILURE\n-   SUCCESS\n\nData type: String\n\n</td></tr></tbody>\n</table>This example shows how to obtain the specified resource from the external provider system \"snow test\".\n\n```\nvar scimClient = new sn_auth.SCIM2Client(); \nvar queryParams = {}; \nvar response = scimClient.executeGetById('snow test','User', 'f282abf03710200044e0bfc8bcbe5d12', queryParams); \ngs.info('response for simple getById: ' + response); \n```\n\nOutput:\n\n```\n// Example of a successful response\n{\n  \"status\":\"SUCCESS\",\n  \"message\":\"{\n    \\\"schemas\\\":[\n      \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\",\n      \\\"urn:ietf:params:scim:schemas:core:2.0:User\\\"\n    ],\n    \\\"id\\\":\\\"f282abf03710200044e0bfc8bcbe5d12\\\",\n    \\\"meta\\\":{\n      \\\"resourceType\\\":\\\"User\\\",\n      \\\"created\\\":\\\"2012-02-18T03:04:53Z\\\",\n      \\\"lastModified\\\":\\\"2021-10-10T19:38:37Z\\\",\n      \\\"location\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Users/f282abf03710200044e0bfc8bcbe5d12\\\"\n    },\n    \\\"userName\\\":\\\"tia.neumaier\\\",\n    \\\"name\\\":{\n      \\\"givenName\\\":\\\"Tia\\\"\n    },\n    \\\"displayName\\\":\\\"Tia Neumaier\\\",\n    \\\"active\\\":true,\n    \\\"emails\\\":[\n      {\n        \\\"value\\\":\\\"tia.neumaier@example.com\\\",\n        \\\"type\\\":\\\"work\\\"\n      }\n    ],\n    \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\":{\n      \\\"costCenter\\\":{\n        \\\"value\\\":\\\"7fb1cc99c0a80a6d30c04574d14c0acf\\\",\n        \\\"name\\\":\\\"Sales\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/CostCenters/7fb1cc99c0a80a6d30c04574d14c0acf\\\"\n      },\n      \\\"company\\\":{\n        \\\"value\\\":\\\"227cdfb03710200044e0bfc8bcbe5d6b\\\",\n        \\\"name\\\":\\\"ACME South America\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Companies/227cdfb03710200044e0bfc8bcbe5d6b\\\"\n      },\n      \\\"department\\\":{\n        \\\"value\\\":\\\"221db0edc611228401760aec06c9d929\\\",\n        \\\"name\\\":\\\"Sales\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Departments/221db0edc611228401760aec06c9d929\\\"\n      },\n      \\\"location\\\":{\n        \\\"value\\\":\\\"25b4c23b0a0a0bb30054836629537509\\\",\n        \\\"name\\\":\\\"Carretera Cancun-Chetumal KM 22, Cancun\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Locations/25b4c23b0a0a0bb30054836629537509\\\"\n      }\n    }\n  }\"\n}\n\n// Example of a failed response\n{\n  \"status\":\"FAILURE\",\n  \"message\":\"{\n    \\\"schemas\\\":[\n      \\\"urn:ietf:params:scim:api:messages:2.0:Error\\\"\n    ],\n    \\\"status\\\":\\\"404\\\",\n    \\\"detail\\\":\\\"User not found f282abf03710200044e0bfc8bcbe5d121\\\"\n  }\"\n}\n```\n\n## SCIM2Client - provision \\(String provider, String resourceName, String resourceId\\)\n\nCreates or updates a resource in an external service provider system for a specified sys\\_id.\n\nFor example, if you create or update a user in a ServiceNow instance, you can use this method to create or update the same resource on an external service provider system. Only those fields which are mapped in the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping \\] table can be created or updated in the corresponding resource.\n\nFor additional information on provider resource mapping, see [Create a SCIM Provider Resource Mapping](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/scim-provider-resource-mapping.md).\n\n<table id=\"table_urc_kcl_btb\" 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\nprovider\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the configured SCIM service provider. The service provider name is defined in the name field of the SCIM Provider \\[sys\\_scim\\_provider\\] table.\n\n</td></tr><tr><td>\n\nresourceName\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the resource type, such as User or Group.Table: In the resource\\_name field of the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping\\] table.\n\n</td></tr><tr><td>\n\nresourceId\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Sys\\_id of the resource saved in the ServiceNow instance \\(the client\\).Table: In the primary\\_table field of the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping\\] table.\n\n</td></tr></tbody>\n</table><table id=\"id_wc2_2fl_btb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nIf the **status** is SUCCESS, the endpoint returns the response body as defined by the REST [SCIM](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/scim-api.md) API.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the request.Possible values:\n\n-   FAILURE\n-   SUCCESS\n\nData type: String\n\n</td></tr></tbody>\n</table>The following example shows how to provision a user on the Snow Provider.\n\n```\nvar scimClient = new sn_auth.SCIM2Client(); \nvar response = scimClient.provision('SNOW Provider','User','f282abf03710200044e0bfc8bcbe5d12'); \ngs.info('response: ' + response);\n```\n\nOutput:\n\n```\n// Example of successful response\n{\n  \"status\":\"SUCCESS\",\n  \"message\":\"{\n    \\\"schemas\\\":[\n      \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\",\n      \\\"urn:ietf:params:scim:schemas:core:2.0:User\\\"\n    ],\n    \\\"id\\\":\\\"f282abf03710200044e0bfc8bcbe5d12\\\",\n    \\\"meta\\\":{\n      \\\"resourceType\\\":\\\"User\\\",\n      \\\"created\\\":\\\"2012-02-18T03:04:53Z\\\",\n      \\\"lastModified\\\":\\\"2021-10-10T19:38:37Z\\\",\n      \\\"location\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Users/f282abf03710200044e0bfc8bcbe5d12\\\"\n    },\n    \\\"userName\\\":\\\"tia.neumaier\\\",\n    \\\"name\\\":{\n      \\\"familyName\\\":\\\"Neumaier\\\",\n      \\\"givenName\\\":\\\"Tia\\\"\n    },\n    \\\"displayName\\\":\\\"Tia Neumaier\\\",\n    \\\"active\\\":true,\n    \\\"emails\\\":[\n      {\n        \\\"value\\\":\\\"tia.neumaier@example.com\\\",\n        \\\"type\\\":\\\"work\\\"\n      }\n    ],\n    \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\":{\n      \\\"gender\\\":\\\"Female\\\",\n      \\\"costCenter\\\":{\n        \\\"value\\\":\\\"7fb1cc99c0a80a6d30c04574d14c0acf\\\",\n        \\\"name\\\":\\\"Sales\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/CostCenters/7fb1cc99c0a80a6d30c04574d14c0acf\\\"\n      },\n      \\\"company\\\":{\n        \\\"value\\\":\\\"227cdfb03710200044e0bfc8bcbe5d6b\\\",\n        \\\"name\\\":\\\"ACME South America\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Companies/227cdfb03710200044e0bfc8bcbe5d6b\\\"\n      },\n      \\\"department\\\":{\n        \\\"value\\\":\\\"221db0edc611228401760aec06c9d929\\\",\n        \\\"name\\\":\\\"Sales\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Departments/221db0edc611228401760aec06c9d929\\\"\n      },\n      \\\"location\\\":{\n        \\\"value\\\":\\\"25b4c23b0a0a0bb30054836629537509\\\",\n        \\\"name\\\":\\\"Carretera Cancun-Chetumal KM 22, Cancun\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Locations/25b4c23b0a0a0bb30054836629537509\\\"\n      }\n    }\n  }\"\n}\n\n// Example of failure response\n{\n  \"status\":\"FAILURE\",\n  \"message\":\"SCIM client attribute or provider resource mapping is not configured properly , \n  No provider resource mapping id found for provider name: SNOW Provider and resource name: User\"\n}\n```\n\n## SCIM2Client - provisionNew \\(String provider, String resourceName, String resourceId\\)\n\nCreates a new resource in an external service provider system for a specified sys\\_id.\n\nFor example, if you create a new user in a ServiceNow instance, you can use this method to create the same resource on an external service provider system. Only those fields which are mapped in the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping\\] table can be created in the corresponding external service provider system. If the resource is already present in the external service provider system, an error response is returned.\n\nFor additional information on provider resource mapping, see [Create a SCIM Provider Resource Mapping](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/scim-provider-resource-mapping.md).\n\n<table id=\"table_csg_wxp_btb\" 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\nprovider\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the configured SCIM service provider. The service provider name is defined in the name field of the SCIM Provider \\[sys\\_scim\\_provider\\] table.\n\n</td></tr><tr><td>\n\nresourceName\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Name of the resource type, such as User or Group.Table: In the resource\\_name field of the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping\\] table.\n\n</td></tr><tr><td>\n\nresourceId\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. Sys\\_id of the resource saved in the ServiceNow instance \\(the client\\).Table: In the primary\\_table field of the SCIM Provider Resource Mapping \\[sys\\_scim\\_provider\\_resource\\_mapping\\] table.\n\n</td></tr></tbody>\n</table><table id=\"id_wc2_2fl_btb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nIf the **status** is SUCCESS, the endpoint returns the response body as defined by the REST [SCIM](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/scim-api.md) API.Data type: String\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nStatus of the request.Possible values:\n\n-   FAILURE\n-   SUCCESS\n\nData type: String\n\n</td></tr></tbody>\n</table>The following example shows how to create a new user in the external service provider SNOW Provider.\n\n```\nvar scimClient = new sn_auth.SCIM2Client(); \nvar response = scimClient.provisionNew('SNOW Provider','User','f282abf03710200044e0bfc8bcbe5d12'); \ngs.info('response: ' + response);\n```\n\nOutput:\n\n```\n// Example of successful response\n{\n  \"status\":\"SUCCESS\",\n  \"message\":\"{\n    \\\"schemas\\\":[\n      \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\",\n      \\\"urn:ietf:params:scim:schemas:core:2.0:User\\\"\n    ],\n    \\\"id\\\":\\\"f282abf03710200044e0bfc8bcbe5d12\\\",\n    \\\"meta\\\":{\n      \\\"resourceType\\\":\\\"User\\\",\n      \\\"created\\\":\\\"2012-02-18T03:04:53Z\\\",\n      \\\"lastModified\\\":\\\"2021-10-10T19:38:37Z\\\",\n      \\\"location\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Users/f282abf03710200044e0bfc8bcbe5d12\\\"\n    },\n    \\\"userName\\\":\\\"tia.neumaier\\\",\n    \\\"name\\\":{\n      \\\"familyName\\\":\\\"Neumaier\\\",\n      \\\"givenName\\\":\\\"Tia\\\"\n    },\n    \\\"displayName\\\":\\\"Tia Neumaier\\\",\n    \\\"active\\\":true,\n    \\\"emails\\\":[\n      {\n        \\\"value\\\":\\\"tia.neumaier@example.com\\\",\n        \\\"type\\\":\\\"work\\\"\n      }\n    ],\n    \\\"urn:ietf:params:scim:schemas:extension:servicenow:2.0:User\\\":{\n      \\\"gender\\\":\\\"Female\\\",\n      \\\"costCenter\\\":{\n        \\\"value\\\":\\\"7fb1cc99c0a80a6d30c04574d14c0acf\\\",\n        \\\"name\\\":\\\"Sales\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/CostCenters/7fb1cc99c0a80a6d30c04574d14c0acf\\\"\n      },\n      \\\"company\\\":{\n        \\\"value\\\":\\\"227cdfb03710200044e0bfc8bcbe5d6b\\\",\n        \\\"name\\\":\\\"ACME South America\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Companies/227cdfb03710200044e0bfc8bcbe5d6b\\\"\n      },\n      \\\"department\\\":{\n        \\\"value\\\":\\\"221db0edc611228401760aec06c9d929\\\",\n        \\\"name\\\":\\\"Sales\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Departments/221db0edc611228401760aec06c9d929\\\"\n      },\n      \\\"location\\\":{\n        \\\"value\\\":\\\"25b4c23b0a0a0bb30054836629537509\\\",\n        \\\"name\\\":\\\"Carretera Cancun-Chetumal KM 22, Cancun\\\",\n        \\\"$ref\\\":\\\"https://empiamsd1.service-now.com/api/now/scim/Locations/25b4c23b0a0a0bb30054836629537509\\\"\n      }\n    }\n  }\"\n}\n\n// Example of failure response\n{\n  \"status\":\"FAILURE\",\n  \"message\":\"SCIM client attribute or provider resource mapping is not configured properly , \n  No provider resource mapping id found for provider name: SNOW Provider and resource name: User\"\n}\n```\n\n"}}