Upload Booking Document
Upload Booking Document
Booking Document
Property
Type
Required
Description
Example Request
#!/usr/bin/env bash
# Configuration variables
API_KEY="apikey"
API_SECRET="apkisecret"
API_VERSION="1.0"
URI_PATH="/api/1.0/venue?action=uploadBookingDocument"
API_URL="[PlatformAddress]${URI_PATH}"
# Get the current date in the required format (UTC timezone)
DATE=$(date -u +"%Y-%m-%d %H:%M:%S")
# Create request data (JSON format)
REQUEST_DATA="{\"venueId\":\"1\",\"bookingId\":\"29836\",\"type\":\"3\",\"status\":\"3\",\"canBeDeleted\":\"1\",\"documentNumber\":\"123\"}"
PATH_TO_FILE="/path/to/document.pdf"
# Compute the MD5 hash of the request data
BODY_MD5=$(echo -n "$REQUEST_DATA" | md5sum | awk '{print $1}')
# Compute the md5 checksum of the file
FILE_MD5=$(md5sum "$PATH_TO_FILE" | awk '{print $1}')
# Set the content-type including the boundary
CONTENT_TYPE="multipart/form-data"
# Prepare the string to sign
STRING_TO_SIGN="POST${BODY_MD5}${FILE_MD5}${CONTENT_TYPE}${URI_PATH}${API_VERSION}ivvydate=${DATE}"
# Convert to lower case
STRING_TO_SIGN="${STRING_TO_SIGN,,}"
# Generate the HMAC signature using the secret key
SIGNATURE=$(echo -n "$STRING_TO_SIGN" | openssl dgst -sha1 -hmac "$API_SECRET" | awk '{print $2}')
# Perform the API call using curl
curl --location "$API_URL" \
--header "Content-Type: ${CONTENT_TYPE}" \
--header "X-Api-Authorization: IWS ${API_KEY}:${SIGNATURE}" \
--header "Content-MD5: ${FILE_MD5}" \
--header "IVVY-Date: ${DATE}" \
--header "X-Api-Version: ${API_VERSION}" \
--form "fileId=@${PATH_TO_FILE}" \
--form "venueId=1" \
--form "bookingId=29836" \
--form "type=3" \
--form "status=3" \
--form "canBeDeleted=1" \
--form "documentNumber=123" \Returns
Property
Description
Throws
Code
Description
Booking Document Type
Type
Description
Booking Document Status
Type
Description
Last updated