Spaces:
Sleeping
Sleeping
Update api_docs.py
Browse files- api_docs.py +9 -25
api_docs.py
CHANGED
@@ -2,11 +2,12 @@
|
|
2 |
|
3 |
import json
|
4 |
|
|
|
5 |
daysoff_api_docs = {
|
6 |
"base_url": "https://aivisions.no/data/daysoff/api/v1/booking/",
|
7 |
"endpoints": {
|
8 |
-
"method": "
|
9 |
-
"description": "Retrieve booking information for a given booking ID
|
10 |
"parameters": {
|
11 |
"auth_token": {
|
12 |
"type": "string",
|
@@ -22,7 +23,7 @@ daysoff_api_docs = {
|
|
22 |
"Content-Type": "application/json"
|
23 |
},
|
24 |
"response": {
|
25 |
-
"description": "A JSON object containing booking details
|
26 |
"content_type": "application/json",
|
27 |
"fields": {
|
28 |
"booking_id": "response.get('booking_id', 'N/A')",
|
@@ -37,25 +38,8 @@ daysoff_api_docs = {
|
|
37 |
}
|
38 |
}
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
"checkin": "response.get('checkin', 'N/A')",
|
46 |
-
"checkout": "response.get('checkout', 'N/A')",
|
47 |
-
"address": "response.get('address', 'N/A')",
|
48 |
-
"user_id": "response.get('user_id', 'N/A')"
|
49 |
-
}
|
50 |
-
|
51 |
-
json_decode = (
|
52 |
-
f"Booking ID: {booking_info['booking_id']}\n"
|
53 |
-
f"Full Name: {booking_info['full_name']}\n"
|
54 |
-
f"Amount: {booking_info['amount']}\n"
|
55 |
-
f"Check-in: {booking_info['checkin']}\n"
|
56 |
-
f"Check-out: {booking_info['checkout']}\n"
|
57 |
-
f"Address: {booking_info['address']}\n"
|
58 |
-
f"User ID: {booking_info['user_id']}"
|
59 |
-
)
|
60 |
-
|
61 |
-
return json_decode
|
|
|
2 |
|
3 |
import json
|
4 |
|
5 |
+
# python dictionary
|
6 |
daysoff_api_docs = {
|
7 |
"base_url": "https://aivisions.no/data/daysoff/api/v1/booking/",
|
8 |
"endpoints": {
|
9 |
+
"method": "GET",
|
10 |
+
"description": "Retrieve booking information for a given booking ID.",
|
11 |
"parameters": {
|
12 |
"auth_token": {
|
13 |
"type": "string",
|
|
|
23 |
"Content-Type": "application/json"
|
24 |
},
|
25 |
"response": {
|
26 |
+
"description": "A JSON object containing booking details.",
|
27 |
"content_type": "application/json",
|
28 |
"fields": {
|
29 |
"booking_id": "response.get('booking_id', 'N/A')",
|
|
|
38 |
}
|
39 |
}
|
40 |
|
41 |
+
auth_token = ""
|
42 |
+
|
43 |
+
daysoff_api_docs_str = json.dumps(daysoff_api_docs, indent=2)
|
44 |
+
# daysoff_api_docs_str = str(daysoff_api_docs)
|
45 |
+
daysoff_api_docs_str
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|