Files
sisvietnamvn_01/HIS_Work_Schedule_API_v3.postman_collection.json

351 lines
8.9 KiB
JSON

{
"info": {
"_postman_id": "a5e8f1d2-3b4c-4e5f-9a8b-7c6d5e4f3a2b",
"name": "HIS Work Schedule API v3.0",
"description": "Postman Collection for SIS SOFT HIS Work Schedule API v3.0 integration, including OAuth2 Token, Work Schedules, Work Schedule Days, and Test Cases.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"variable": [
{
"key": "baseUrl",
"value": "https://dhs.sisvietnam.vn",
"type": "string"
},
{
"key": "clientId",
"value": "DigitalHealthSolutions_HospitalIntegration",
"type": "string"
},
{
"key": "clientSecret",
"value": "XPWFParRQldtZopqdDFLPYblIzauxuWT",
"type": "string"
},
{
"key": "scope",
"value": "HospitalIntegration",
"type": "string"
},
{
"key": "tenantId",
"value": "3a0f747c-57b6-753b-ba21-3987e8e93b9a",
"type": "string"
},
{
"key": "accessToken",
"value": "",
"type": "string"
},
{
"key": "doctorCode",
"value": "01472",
"type": "string"
}
],
"item": [
{
"name": "01 - Get Hospital Integration Token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();",
"if (jsonData.access_token) {",
" pm.collectionVariables.set('accessToken', jsonData.access_token);",
" pm.environment.set('accessToken', jsonData.access_token);",
" console.log('Access token saved successfully.');",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
},
{
"key": "client_id",
"value": "{{clientId}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{clientSecret}}",
"type": "text"
},
{
"key": "scope",
"value": "{{scope}}",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/connect/token",
"host": [
"{{baseUrl}}"
],
"path": [
"connect",
"token"
]
},
"description": "OAuth 2.0 Client Credentials token request. Saves access_token into collection/environment variable {{accessToken}}."
},
"response": []
},
{
"name": "02 - Get Doctors With Work Schedules",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();",
"if (jsonData.data && jsonData.data.doctors && jsonData.data.doctors.length > 0) {",
" var code = jsonData.data.doctors[0].doctorCode;",
" pm.collectionVariables.set('doctorCode', code);",
" console.log('Saved doctorCode:', code);",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}",
"type": "text"
},
{
"key": "__tenant",
"value": "{{tenantId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/api/app/his/doctors/work-schedules?fromDate=2026-07-28&toDate=2026-08-11",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"app",
"his",
"doctors",
"work-schedules"
],
"query": [
{
"key": "fromDate",
"value": "2026-07-28"
},
{
"key": "toDate",
"value": "2026-08-11"
}
]
},
"description": "Returns list of doctors with active work schedules in requested date range."
},
"response": []
},
{
"name": "03 - Get Doctor Work Schedule Days",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}",
"type": "text"
},
{
"key": "__tenant",
"value": "{{tenantId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/api/app/his/doctors/{{doctorCode}}/work-schedule-days?fromDate=2026-07-28&toDate=2026-08-11",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"app",
"his",
"doctors",
"{{doctorCode}}",
"work-schedule-days"
],
"query": [
{
"key": "fromDate",
"value": "2026-07-28"
},
{
"key": "toDate",
"value": "2026-08-11"
}
]
},
"description": "Returns active work schedule days for a specific doctorCode."
},
"response": []
},
{
"name": "04 - Invalid Date Format (HTTP 400)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}",
"type": "text"
},
{
"key": "__tenant",
"value": "{{tenantId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/api/app/his/doctors/work-schedules?fromDate=28-07-2026",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"app",
"his",
"doctors",
"work-schedules"
],
"query": [
{
"key": "fromDate",
"value": "28-07-2026"
}
]
},
"description": "Test case for HTTP 400 WORK_SCHEDULE_INVALID_DATE_FORMAT."
},
"response": []
},
{
"name": "05 - Missing Token (HTTP 401)",
"request": {
"method": "GET",
"header": [
{
"key": "__tenant",
"value": "{{tenantId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/api/app/his/doctors/work-schedules",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"app",
"his",
"doctors",
"work-schedules"
]
},
"description": "Test case for HTTP 401 UNAUTHORIZED when Authorization header is omitted."
},
"response": []
},
{
"name": "06 - Invalid Client Token (HTTP 403)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer INVALID_CLIENT_TOKEN",
"type": "text"
},
{
"key": "__tenant",
"value": "{{tenantId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/api/app/his/doctors/work-schedules",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"app",
"his",
"doctors",
"work-schedules"
]
},
"description": "Test case for HTTP 403 FORBIDDEN when using token from wrong client or scope."
},
"response": []
},
{
"name": "07 - Doctor Not Found (HTTP 404)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{accessToken}}",
"type": "text"
},
{
"key": "__tenant",
"value": "{{tenantId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/api/app/his/doctors/UNKNOWN_DOCTOR_CODE/work-schedule-days",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"app",
"his",
"doctors",
"UNKNOWN_DOCTOR_CODE",
"work-schedule-days"
]
},
"description": "Test case for HTTP 404 DOCTOR_NOT_FOUND when doctorCode does not exist."
},
"response": []
}
]
}