{"openapi":"3.1.0","info":{"description":"API will help to create bookings for fee paid judges and would provided APIs to Fetch and create booking.","title":"AM Judicial Booking Service"},"externalDocs":{"description":"README","url":"https://github.com/hmcts/am-judicial-booking-service#readme"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"paths":{"/am/bookings":{"post":{"operationId":"createBooking","parameters":[{"in":"header","name":"x-correlation-id","required":false,"schema":{"type":"string"}},{"description":"Keyword `Bearer` followed by a valid IDAM user token","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Valid Service-to-Service JWT token for a whitelisted micro-service","in":"header","name":"ServiceAuthorization","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/bookingRequest"}}},"required":true},"responses":{"201":{"content":{"application/vnd.uk.gov.hmcts.judicial-booking-service.create-booking+json;charset=UTF-8;version=1.0":{"schema":{"$ref":"#/components/schemas/BookingResponse"}}},"description":"Created"},"400":{"description":"Request is not valid as per validation rule"}},"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"summary":"Creates booking for a fee-pay judge","tags":["create-booking-controller"]}},"/am/bookings/query":{"post":{"description":"Retrieves bookings based on queried user ID's","operationId":"queryBookings","parameters":[{"in":"header","name":"x-correlation-id","required":false,"schema":{"type":"string"}},{"description":"Keyword `Bearer` followed by a valid IDAM user token","in":"header","name":"Authorization","required":true,"schema":{"type":"string"}},{"description":"Valid Service-to-Service JWT token for a whitelisted micro-service","in":"header","name":"ServiceAuthorization","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingQueryRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingQueryResponse"}}},"description":"Success"},"400":{"description":"Request is not valid as per validation rule"}},"security":[{"Authorization":[]},{"ServiceAuthorization":[]}],"tags":["query-booking-controller"]}}},"components":{"schemas":{"BookingEntity":{"type":"object","properties":{"beginTime":{"type":"string","format":"date-time"},"created":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"locationId":{"type":"string"},"log":{"type":"string"},"regionId":{"type":"string"},"userId":{"type":"string"}}},"BookingQueryRequest":{"type":"object","properties":{"queryRequest":{"$ref":"#/components/schemas/UserRequest"}}},"BookingQueryResponse":{"type":"object","properties":{"bookings":{"type":"array","items":{"$ref":"#/components/schemas/BookingEntity"}}}},"BookingRequest":{"type":"object","properties":{"beginDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"locationId":{"type":"string"},"regionId":{"type":"string"},"userId":{"type":"string"}}},"BookingResponse":{"type":"object","properties":{"bookingResponse":{"$ref":"#/components/schemas/BookingEntity"}}},"UserRequest":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}}}},"bookingRequest":{"type":"object","properties":{"bookingRequest":{"$ref":"#/components/schemas/BookingRequest"}}}},"securitySchemes":{"Authorization":{"bearerFormat":"JWT","description":"Valid IDAM user token, (Bearer keyword is added automatically)","name":"Authorization","scheme":"bearer","type":"http"},"ServiceAuthorization":{"bearerFormat":"JWT","description":"Valid Service-to-Service JWT token for a whitelisted micro-service","in":"header","name":"ServiceAuthorization","scheme":"bearer","type":"apiKey"}}}}
