Skip to main content
Skip table of contents

The Holibob API - Uploading file to booking question of type `file`

Below is the interim solution to support file upload for a booking. There is a specific question type of FILE that needs to be available on the product to support this functionality.

  1. Ensure you have question of type file created via Holibob

  2. Follow standard booking flow until you reach the questions for the booking

  3. Execute the /getBookingUploadUrl mutation to retrieve a signed url to which you can upload a file (mutation has to be run for each booking question of type file )
    Note that you need to provide bookingId and bookingQuestionId

    GRAPHQL
    mutation getBookingUploadUrl($bookingId: ID!, $bookingQuestionId: ID!) {
        bookingQuestionUpload(bookingId: $bookingId, bookingQuestionId: $bookingQuestionId, contentType: "application/pdf") {
            uploadUrl
        }
    }
  4. Upload a file by sending PUT request to uploadUrl. Examples with HTTP:

    1. PDF Example

      BASH
       http PUT '[uploadUrlGoesHere]' \
        Content-Type:application/pdf \
        x-amz-acl:private < file.pdf
    2. Image Example

      BASH
       http PUT '[uploadUrlGoesHere]' \
        Content-Type:image/jpeg \
        x-amz-acl:private < image.jpeg
  5. Answer the booking question with value of "true" and follow the standard flow to commit the booking
    Example answer below:

    JSON
    {
      "questionId": "826f12ad-363a-40c4-a1e5-9856302dd342",
      "value": "true"
    }
  6. Once answer value is set to true you can query answerFile field to receive path to the file

    GRAPHQL
    query useBooking($id: String!, $input: BookingInput) {
      booking(id: $id, input: $input) {
          questionList {
              nodes {
                  id
                  answerFile # url to file
                  answerValue
                  answerFormattedText
              }
          }
      }
    }

Maximum file size is 10MB

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.