File size: 1,508 Bytes
47de06c 70464c1 103353a 8f1ef15 47de06c 3892162 3373607 47de06c 3373607 47de06c 8f1ef15 70464c1 47de06c 3373607 47de06c 70464c1 103353a 70464c1 103353a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
### api_docs.py
import json
# python dictionary
api_docs = {
"api_url": "https://aivisions.no/data/daysoff/api/v1/booking/",
"endpoints": {
"/bestillingsnummer": {
"method": "GET",
"description": "Retrieve booking details for a given booking ID.",
"parameters": {
"booking_id": {
"type": "string",
"description": "Alphanumeric identifier, (6 capital letters followed by 6 digits, e.g., DAGHNS116478) of the booking to retrieve.",
"regex_pattern": "^[A-Z]{6}\\d{6}$",
}
},
"headers": {
"Authorization": "Bearer <auth_token>",
"Content-Type": "application/json"
},
"api_response": {
"description": "A JSON object containing booking details.",
"content_type": "application/json",
"booking_info": {
"booking_id": "response.get('booking_id', 'N/A')",
"full_name": "response.get('full_name', 'N/A')",
"amount": "response.get('amount', 'N/A')",
"checkin": "response.get('checkin', 'N/A')",
"checkout": "response.get('checkout', 'N/A')",
"address": "response.get('address', 'N/A')",
"user_id": "response.get('user_id', 'N/A')"
}
}
}
}
auth_token = ""
api_docs_str = json.dumps(api_docs, indent=2)
# daysoff_api_docs_str = str(daysoff_api_docs)
api_docs_str |