{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":13038,"path":"employee-service-management/safe-workplace/get-health-data.md","title":"Subscribe to request for entry updates","bundle":null,"doc_type":null,"release":"australia","body":"\n# Subscribe to request for entry updates\n\nSend the result of each Employee Health Screening entry request to a third-party system by configuring a webhook.\n\n## Before you begin\n\nSending outbound webhook calls requires the following plugins.\n\n-   ServiceNow Integration Hub Runtime \\(com.glide.hub.integration.runtime\\)\n-   Workflow Studio Action Step - Payload Builder \\(com.glide.hub.action\\_step.payload\\)\n-   ServiceNow Integration Hub Action Step - REST \\(com.glide.hub.action\\_step.rest\\)\n\nThese plugins must be requested through the Now Support Service Catalog. For instructions, see [Request a plugin](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-administration/t_RequestAPlugin.md).\n\nWhen you set up the webhook, the system automatically sends a REST request to a third-party endpoint every time an employee or visitor requests entry. Work with an administrator for the third-party system to determine the correct endpoint to provide.\n\n**Note:** The webhook does not include authentication headers in the request. Ensure that you provide an endpoint that includes query parameters to authenticate the request.\n\nTo learn more about the Employee Health Screening Request Entry module, see [Conduct a health screen for entry](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/safe-workplace/screen-returning-employee.md).\n\nRole required: sn\\_imt\\_core.admin or admin\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Employee Health and Safety Status** &gt; **Outbound Webhooks**.\n\n2.  In the Webhook \\[sn\\_imt\\_core\\_webhook\\] table, click **New**.\n\n3.  On the form, fill in the fields.\n\n<table id=\"table_x1v_zf2_hmb\"><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\nInternal identifier for the third-party endpoint.\n\n</td></tr><tr><td>\n\nEvent\n\n</td><td>\n\nEvent that you want to subscribe to. Options include:-   **Employee requested entry**: Sends an update every time an employee requests entry.\n-   **Visitor requested entry**: Sends an update every time a visitor requests entry.\n\n\n</td></tr><tr><td>\n\nEndpoint\n\n</td><td>\n\nEndpoint to send the Employee Health Screening Request Entry data to.**Note:** The webhook does not include authentication headers in the request. Ensure that you provide an endpoint that includes query parameters to authenticate the request.\n\n</td></tr><tr><td>\n\nSecure parameters\n\n</td><td>\n\nQuery parameters for the endpoint that must be handled securely, such as an authorization token. Provide parameters in the format `?param1=value&param2=othervalue`.**Tip:** If the third-party system that you're sending data to doesn't provide a securely generated authorization token, you can generate a token in your ServiceNow instance with the following script.\n\n```\nvar secureRandom = GlideSecureRandomUtil;\nvar secret = secureRandom.getSecureRandomString(30);\ngs.log(secret);\n```\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nOption to set the record to active.\n\n</td></tr></tbody>\n</table>4.  Click **Submit**.\n\n\n## Result\n\nThe Employee Health Screening application sends request entry data to the third-party endpoint every time an employee requests entry. The JSON payload contains the following data.\n\n```\n{\n  \"event\": \"entry.requested\",\n  \"email\": \"aileen.mottern@example.com\",\n  \"username\": \"aileen.mottern\",\n  \"user_id\": \"a8f98bb0eb32010045e1a5115206fe3a\",\n  \"location\": \"San Antonio\",\n  \"location_id\": \"108486c7c611227500b093211aa88dcc\",\n  \"access_granted\": false,\n  \"updated\": \"2020-07-01 22:19:03\"\n}\n```\n\n<table id=\"table_tmh_dl2_hmb\"><thead><tr><th>\n\nProperty\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nevent\n\n</td><td>\n\nType of event defined in the Webhook table. Data type: String\n\n</td></tr><tr><td>\n\nemail\n\n</td><td>\n\nEmail address of the employee.Data type: String\n\n</td></tr><tr><td>\n\nusername\n\n</td><td>\n\nUsername of the employee from the Health and Safety Users \\[sn\\_imt\\_core\\_health\\_and\\_safety\\_user\\] table.Data type: String\n\n</td></tr><tr><td>\n\nuser\\_id\n\n</td><td>\n\nSys\\_id of the user record from the Health and Safety Users \\[sn\\_imt\\_core\\_health\\_and\\_safety\\_user\\] table. Data type: String\n\n</td></tr><tr><td>\n\nlocation\n\n</td><td>\n\nLocation of the health screening. Data type: String\n\n</td></tr><tr><td>\n\nlocation\\_id\n\n</td><td>\n\nSys\\_id of the location record from the Location \\[cmn\\_location\\] table.Data type: String\n\n</td></tr><tr><td>\n\naccess\\_granted\n\n</td><td>\n\nFlag that indicates whether the employee was granted access as a result of the health screening. Valid values:-   **true**: The employee passed the health screening and was granted access.\n-   **false**: The employee did not pass the health screening and was not granted access.\n\n Data type: Boolean\n\n</td></tr><tr><td>\n\nupdated\n\n</td><td>\n\nDate and time when the employee or visitor requested entry.Data type: Date/Time\n\n</td></tr></tbody>\n</table>"}}