HR Leave · Australia

REST API Explorer — HR Leave App (quick reference)

ServiceNow Australia · Custom app · Arabic + English readable · scripts copy/paste ready

App typeCustom
Scopex_786686_hr_leave
sys_idc84db0e8839f0b509f02b0d6feaad3c9
Replace{BASE} = your instance
Instance URLs Application Leave requests Business Rules Studio

REST API Explorer — HR Leave App (quick reference)

Use this before Postman and before writing integration scripts.
الأسلوب: عربية + إنجليزية تكمّلان بعضهما — بدون ترجمة حرفية لأسماء الشاشات.

Open Explorer

Navigate:
All > System Web Services > REST API Explorer — Open direct

Direct URL:
https://.service-now.com/$restapi.do — افتح الـ Explorer من القائمة أو من الرابط أعلاه (استبدل اسم المثيل).


Use when external system only needs to create/read/update leave records.

Setting Value
Namespace now
API name Table
Table x_786686_hr_leave_req_v2
Method POST (create) / GET (read) / PATCH (update)

Request URL (shown by Explorer):
/api/now/table/x_786686_hr_leave_req_v2

POST body example (Request Body tab):

{
 "u_requested_for_user": "<sys_user sys_id>",
 "u_employee_ref": "<employee_v2 sys_id>",
 "u_leave_type": "annual",
 "u_start_date": "2026-06-01",
 "u_end_date": "2026-06-05",
 "u_state": "submitted",
 "u_reason": "API test from REST API Explorer"
}

Steps in Explorer:
1. Select namespace now → API Table.
2. Choose table x_786686_hr_leave_req_v2.
3. Method POST → paste JSON in Request body.
4. Click Send.
5. Check Response (201 + result object) and verify list x_786686_hr_leave_req_v2.list.

Copy for external team:
- Copy as cURL (button in Explorer) → gives exact URL + headers for HRIS team.


Path B — Scripted REST (custom logic — our app API)

Setup first: SCRIPTED_REST_INBOUND_SETUP.md

Use when you need validation, employee lookup by employee_id, and HRLXProIntegrationUtilsV2.

Setting Value
Namespace x_786686_hr_leave
API name hrlx_api_v2
Resource leave
Method POST

Request URL:
/api/x_786686_hr_leave/hrlx_api_v2/leave

POST body:

{
 "employee_id": "EMP001",
 "leave_type": "annual",
 "start_date": "2026-06-01",
 "end_date": "2026-06-05",
 "reason": "Vacation"
}

Script file:
inbound_scripted_rest_leave.js


Outbound — REST Message (NOT Explorer)

Full setup: OUTBOUND_REST_MESSAGE_SETUP.md

REST Message field Value
Name HRLX ERP Push Decision
Endpoint x_786686_hr_leave.config.erp_endpoint
HTTP Method Push Decision POST (not Default GET)
Test HTTP Method → Send

Explorer = inbound only. Outbound = REST Message Send.


Authentication in Explorer

Mode When
Logged-in session You are admin/dev testing in browser — Explorer uses your session cookie
Basic Auth Impersonate integration user or use Basic in cURL copy
OAuth Production; register client → token → Authorization header

Integration user (lab):
hrlx.integration + role rest_service + app insert ACL on x_786686_hr_leave_req_v2.


Response codes (practice)

Code Meaning
201 Created (POST success)
200 OK (GET/PATCH success)
400 Bad JSON / validation
401 Not authenticated
403 ACL / role denied
404 Wrong table or API path

Full guide

File: ../../12_INTEGRATION_FULL_GUIDE.md