camparchimedes commited on
Commit
35fdf97
ยท
verified ยท
1 Parent(s): 9ae03a5

Create api_docs.py

Browse files
Files changed (1) hide show
  1. api_docs.py +39 -0
api_docs.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### api_docs.py
2
+
3
+ import json
4
+
5
+ api_docs = {
6
+ "base_url": "https://aivisions.no/data/daysoff/api/v1/booking/",
7
+ "endpoints": {
8
+ "/": {
9
+ "method": "POST",
10
+ "description": "Retrieve booking information associated with a booking ID.",
11
+ }
12
+ },
13
+ "body": {
14
+ "booking_id": "string"
15
+ },
16
+ "headers": {
17
+ "Authorization": "Bearer <auth_token>",
18
+ "Content-Type": "application/json"
19
+ },
20
+ "response": {
21
+ "description": "A JSON object containing booking details for a specific booking ID.",
22
+ "Content-Type": "application/json",
23
+ "booking_info": {
24
+ "booking_id": {"description": "The unique identifier for the booking.", "mapping": "response.get('booking_id', 'N/A')"},
25
+ "full_name": {"description": "The full name of the customer associated with the booking.", "mapping": "response.get('full_name', 'N/A')"},
26
+ "amount": {"description": "The total amount for the booking (integer).", "mapping": "response.get('amount', 0)"},
27
+ "checkin": {"description": "The check-in date for the booking (ISO 8601).", "mapping": "response.get('checkin', 'N/A')"}, # --datetime format is 2024-12-20T15:00:00
28
+ "checkout": {"description": "The check-out date for the booking (ISO 8601).", "mapping": "response.get('checkout', 'N/A')"},
29
+ "address": {"description": "The address associated with the booking.", "mapping": "response.get('address', 'N/A')"},
30
+ "user_id": {"description": "The user ID associated with the booking (integer).", "mapping": "response.get('user_id', 0)"},
31
+ "infotext": {"description": "Additional information related to the booking.", "mapping": "response.get('infotext', 'N/A')"},
32
+ "included": {"description": "Details of services included in the booking.", "mapping": "response.get('included', 'N/A')"}
33
+ }
34
+ }
35
+ }
36
+
37
+
38
+ api_docs_str = json.dumps(api_docs, indent=2)
39
+ api_docs_str