68 lines
1.8 KiB
HTTP
68 lines
1.8 KiB
HTTP
### Shortlink Authentication Test File
|
|
@baseUrl = http://localhost:5555
|
|
@adminToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNiIsImVtYWlsIjoiYWRtaW5AZXhhbXBsZS5jb20iLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX25hbWUiOiJBZG1pbiBVc2VyIiwidG9rZW5fdHlwZSI6ImFjY2VzcyIsImhvbWVfdXJsIjoiLyIsInN0dWR5X2xpc3QiOiJlbmFibGVkIiwiZXhwIjoxNzQ3MzY0NjgxLCJpYXQiOjE3NDcyNzgyODF9.bkzxV8f26wN_r6uI5T6o58TNX4U0z-Wel1hCAl5-8ag
|
|
|
|
### 1. Generate Short Link Single Study (Tidak ganti untuk 1 patient sampai expired)
|
|
POST {{baseUrl}}/generate-link
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{adminToken}}
|
|
|
|
{
|
|
"patient_id": "MR00000359",
|
|
"study_uid": "1.2.826.0.1.3680043.9.7307.1.202503196393.01",
|
|
"dob": "2001-10-07",
|
|
"expires_in": 48
|
|
}
|
|
|
|
### 2. Generate Short Link Multiple Studies
|
|
POST {{baseUrl}}/generate-link
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{adminToken}}
|
|
|
|
{
|
|
"patient_id": "00211622",
|
|
"study_uid": "1.2.826.0.1.3680043.9.7307.1.20180713036",
|
|
"dob": "1980-01-01",
|
|
"expires_in": 48
|
|
}
|
|
|
|
###
|
|
POST {{baseUrl}}/generate-link
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{adminToken}}
|
|
|
|
{
|
|
"patient_id": "00211622",
|
|
"study_uid": "1.2.826.0.1.3680043.9.7307.1.20180530066",
|
|
"dob": "1980-01-01",
|
|
"expires_in": 48
|
|
}
|
|
|
|
### Authenticate correct
|
|
POST {{baseUrl}}/auth/shortlink
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"short_token": "DZDWF",
|
|
"dob": "2001-10-07"
|
|
}
|
|
|
|
### Authenticate with Incorrect DOB
|
|
POST {{baseUrl}}/auth/shortlink
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"short_token": "HNHh_zem",
|
|
"dob": "2001-10-00"
|
|
}
|
|
|
|
### Recycle shortcode from expired or revoked token
|
|
POST {{baseUrl}}/recycle-shortcode
|
|
Authorization: Bearer {{adminToken}}
|
|
Content-Type: application/json
|
|
### Check the response from recycling
|
|
# The response should include:
|
|
# - status: "success"
|
|
# - message: "Shortcodes recycled successfully"
|
|
# - count: number of recycled shortcodes (integer)
|