{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":13769,"path":"employee-service-management/workplace-connectors/configure-webhook-restapi.md","title":"Configure a webhook event","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure a webhook event\n\nConfigure a webhook API event in the Provider configuration table to enable badging vendors to share the badging data collected from badging tables using the webhook event.\n\n## Before you begin\n\nRole required: sn\\_wsd\\_wc.admin\n\n## About this task\n\nThe badging data \\(JSON\\) is processed using the ServiceNow Rest API explorer. Single or multiple raw badging data records \\(payload\\) can be shared and processed using the REST API explorer. The webhook event for badging data is loaded to the Connector Events table in single or multiple JSON records. Multiple records are sent as an array. For more information, see [Attendance Analytics](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/workplace-connectors/attendance-analytics.md).\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Workplace Connectors** &gt; **Provider Connector Configurations**.\n\n2.  Select **Create New**.\n\n    On the form, fill in the fields.\n\n<table id=\"table_vct_344_vyb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName for the provider configuration.\n\n</td></tr><tr><td>\n\nSource Type\n\n</td><td>\n\nSource from where the badging data is collected and loaded into the target Employee attendance table. Select **Webhook** to configure the webhook event.\n\n</td></tr><tr><td>\n\nToken Param Name\n\n</td><td>\n\nThe **Token Param Name** and **Token value** is a secret key-value pair, which is used to authenticate the API call from the vendor badging system to the Workplace Connectors application. Both systems have the token name value. Using the token name, the application authenticates the API request.\n\n</td></tr><tr><td>\n\nToken value\n\n</td><td>\n\nThe token value is the secret key used by the badging vendor while calling the API event to let the server authenticate the API request.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nOption to indicate that the provider configuration is Active.\n\n</td></tr><tr><td>\n\nConnector Configuration\n\n</td><td>\n\nOption to search for and select the lookup list icon \\(\\[Omitted image \"look-up-icon.png\"\\] Alt text: Lookup list icon.\\) to select **Badging**. For more information, see [Configure connectors for badging data](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/workplace-connectors/workplace-connector-configuration.md).\n\n</td></tr><tr><td>\n\nCallback URL\n\n</td><td>\n\nOption to select the callback URL icon \\(\\[Omitted image \"wsd-callback-url-icon.png\"\\] Alt text: Callback URL icon.\\) to lock or edit the callback URL.\n\n</td></tr></tbody>\n</table>3.  Select **Update**.\n\n4.  Select the newly created webhook event.\n\n    The Generate Callback URL button is available to generate a callback URL for the REST API request.\n\n5.  As a badging vendor, share the badging data in JSON format by navigating to **All** &gt; **System Web Services** &gt; **REST** &gt; **Rest API Explorer**.\n\n6.  In the Rest API Explorer page, select the following:\n\n    -   Namespace: From the drop-down list, select **sn\\_wsd\\_wc**\n    -   API Name: Workplace Connector Webhook\n    -   API Version: v1\n7.  On the Workplace Connector Webhook event page, provide the following values:\n\n    -   token\\_name: Token param name used in step 2. The token name value is used by badging vendors to share the badging data \\(JSON\\) with Workplace Connectors. The raw data \\(payload or badging data\\) is processed and loaded into the Connector Events table.\n    -   ni.nolog.id: Copy the System ID of the webhook created in step 2 and paste it. Select the additional actions menu icon \\(\\[Omitted image \"additional-actions-icon.png\"\\] Alt text: Additional actions menu icon.\\) from the pane.\n    -   token\\_value: Token value provided in step 2. The token value is the secret key used by the badging vendor while calling the API event to let the server authenticate the API request.\n    1.  In the API Request body, select **Raw** and copy the badging data \\(payload\\) in JSON format.\n\n        This badging data is collected from badging sensors.\n\n    2.  Select **Send**.\n\n        If the Response code is **200 OK** and the response result is **Success**, the badging data is loaded into the Connector Events table.\n\n        -   The Connector Events table \\(sn\\_wsd\\_wc\\_connector\\_events\\) loads the badging data shared by badging vendors. The State of the badging data is **New** when it’s loaded by the REST API Explorer.\n        -   The scheduled Job **Process webhook provider data records** runs every minute to load the badging data from the Connector Events table \\(data with the State **New**\\) to the Employee Attendance Data table.\n    The scheduled job takes the source data from the **Webhook** event to transform the data in the required format and then place it in the target Employee Attendance Data table.\n\n    **Note:** To access the Workplace Connectors scheduled jobs, navigate to **All** &gt; **System Definition** &gt; **Scheduled jobs**. Search for **Workplace connectors** in the Application column. Two scheduled jobs are available for Workplace Connectors.\n\n    -   **Process provider data records**: Reads data from vendor badging data \\(source table\\). After processing the badging data, the record loads it into the Employee Attendance Data table \\(target table\\). For more information, see [Configure badging table data](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/workplace-connectors/provider-configuration-wsd-connectors.md).\n    -   **Process webhook provider data records**: Reads data from the Connector Events table. Processes the webhook event data and loads it into the Employee Attendance Data table \\(target table\\).\n    -   Data is loaded to the Employee Attendance Data table. The state of the badging data in the Connector Events table changes to **Processed**.\n    -   From the Employee Attendance Data table, the data is loaded into the Attendance Analytics table.\n\n        **Note:** Badging data records in the Connector Events table with the state of Processed are purged after two days from the date of creation or the current date by the Connector Events table \\[sn\\_wsd\\_wc\\_connector\\_events\\]. Data in the Error state is purged after seven days from the date of creation. Data in the New state isn’t purged.\n\n\n**Parent Topic:**[Provider connector configuration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/workplace-connectors/provider-configuration-ovw.md)\n\n**Previous topic:**[Configure badging table data](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/workplace-connectors/provider-configuration-wsd-connectors.md)\n\n**Next topic:**[Employee attendance data](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/workplace-connectors/employee-attendance.md)\n\n"}}