Check appointment code
GET
{{server}}/api/v1/smart/booking?branch={{branch}}&bookingCode=118762This request checks the booking code. If it exists, it returns the details of reservation. If it's not, it returns status 400.
Request
Authorization
| Header | Value |
|---|---|
Authorization | SmartToken {{smartToken}} |
Headers
| Key | Value |
|---|---|
Accept | application/json |
Query parameters
| Key | Value |
|---|---|
branch | {{branch}} |
bookingCode | 118762 |
Code snippets
- cURL
- JavaScript
- Python
curl -X GET '{{server}}/api/v1/smart/booking?branch={{branch}}&bookingCode=118762' \
-H 'Accept: application/json' \
-H 'Authorization: SmartToken {{smartToken}}'
const response = await fetch("{{server}}/api/v1/smart/booking?branch={{branch}}&bookingCode=118762", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "SmartToken {{smartToken}}"
},
});
const data = await response.json();
console.log(data);
import requests
url = "{{server}}/api/v1/smart/booking?branch={{branch}}&bookingCode=118762"
headers = {
"Accept": "application/json",
"Authorization": "SmartToken {{smartToken}}"
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
Examples (2)
- Invalid booking code
- Valid booking code
Example request
GET
{{server}}/api/v1/smart/booking?branch={{branch}}&bookingCode=123456Query parameters (2)
| Key | Value |
|---|---|
branch | {{branch}} |
bookingCode | 123456 |
Headers (1)
| Key | Value |
|---|---|
Accept | application/json |
Example response 400 Bad Request
Response headers (9)
| Key | Value |
|---|---|
Access-Control-Expose-Headers | * |
Cache-Control | no-store, no-cache, must-revalidate |
Access-Control-Allow-Origin | * |
Access-Control-Allow-Methods | POST, PUT, GET, OPTIONS, DELETE |
Access-Control-Allow-Credentials | true |
Content-Length | 2695 |
Access-Control-Max-Age | 86400 |
Access-Control-Allow-Headers | Content-Type, Authorization, X-Requested-With |
Content-Type | application/json;charset=utf-8 |
Body
{
"name": "BookingInvalid",
"message": "The specified booking code is not valid!",
"nodeID": "norbi-pc3-28340",
"code": 400,
"type": "BOOKING_CODE_INVALID",
"retryable": false,
"stack": "services.moleculer.error.MoleculerClientError: The specified booking code is not valid!\r\n\tat com.qnet7.core.ErrorFactory.bookingCodeInvalid(ErrorFactory.java:257)\r\n\tat com.qnet7.appointment.impl.internal.InternalBookingQuery.lambda$getAppointment$3(InternalBookingQuery.java:189)\r\n\tat io.datatree.Promise.lambda$1(Promise.java:433)\r\n\tat java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:836)\r\n\tat java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:848)\r\n\tat java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2168)\r\n\tat io.datatree.Promise.then(Promise.java:428)\r\n\tat com.qnet7.appointment.impl.internal.InternalBookingQuery.getAppointment(InternalBookingQuery.java:185)\r\n\tat com.qnet7.appointment.AppointmentFactory.getAppointment(AppointmentFactory.java:609)\r\n\tat com.qnet7.published.v1.PublishedServiceV1.getAppointment(PublishedServiceV1.java:223)\r\n\tat com.qnet7.published.v1.SmartTicket.lambda$2(SmartTicket.java:154)\r\n\tat services.moleculer.service.LocalActionEndpoint.lambda$0(LocalActionEndpoint.java:90)\r\n\tat com.qnet7.acl.ActionPermissionController.lambda$null$2(ActionPermissionController.java:262)\r\n\tat io.datatree.Promise.lambda$0(Promise.java:403)\r\n\tat java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:836)\r\n\tat java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:848)\r\n\tat java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2168)\r\n\tat io.datatree.Promise.then(Promise.java:398)\r\n\tat com.qnet7.acl.ActionPermissionController.lambda$install$3(ActionPermissionController.java:246)\r\n\tat services.moleculer.metrics.MetricMiddleware$1.lambda$0(MetricMiddleware.java:74)\r\n\tat io.datatree.Promise.<init>(Promise.java:261)\r\n\tat services.moleculer.metrics.MetricMiddleware$1.handler(MetricMiddleware.java:59)\r\n\tat services.moleculer.service.ActionEndpoint.handler(ActionEndpoint.java:85)\r\n\tat services.moleculer.service.DefaultServiceInvoker.call(DefaultServiceInvoker.java:132)\r\n\tat services.moleculer.service.DefaultServiceInvoker.call(DefaultServiceInvoker.java:123)\r\n\tat services.moleculer.web.router.ActionInvoker.lambda$1(ActionInvoker.java:236)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n\tat java.lang.Thread.run(Thread.java:748)",
"data": {
"bookingCode": "123456"
}
}
Example request
GET
{{server}}/api/v1/smart/booking?branch={{branch}}&bookingCode=118762Query parameters (2)
| Key | Value |
|---|---|
branch | {{branch}} |
bookingCode | 118762 |
Headers (1)
| Key | Value |
|---|---|
Accept | application/json |
Example response 200 Ok
Response headers (9)
| Key | Value |
|---|---|
Access-Control-Expose-Headers | * |
Cache-Control | no-store, no-cache, must-revalidate |
Access-Control-Allow-Origin | * |
Access-Control-Allow-Methods | POST, PUT, GET, OPTIONS, DELETE |
Access-Control-Allow-Credentials | true |
Content-Length | 325 |
Access-Control-Max-Age | 86400 |
Access-Control-Allow-Headers | Content-Type, Authorization, X-Requested-With |
Content-Type | application/json;charset=utf-8 |
Body
{
"start": 1745830800000,
"language": "00000000-0000-4000-0004-000000000001",
"branch": "00000000-0000-4000-0003-000000000001",
"service": "00000000-0000-4000-0007-000000000006",
"client": {
"name": "John Doe",
"phone": "+33445678923",
},
"bookingCode": "118762",
"verified": true,
"length": 15,
"time": 1745830020583
}