Upload and attach a file


This guide describes the way you can upload a file to the Inspectorio Sight system and then attach this uploaded file to a component to visible it on the Sight platform.

Instructions

With these general steps, you can upload your files (up to 300 MB) to the Inspectorio Sight system, and then attach the uploaded files to a Sight component such as Inspection.

Precondition

  • Generate an API Key for your Sight organization and use it to authenticate your Sight API requests

Steps

  1. Write a script using the File Upload Session API to request a new session with your expected file name & extension. Then copy the link in the uploadSession field in the response body.

    NOTE:

    • The file name must be unique for your organization. You will get an error message when trying to request session with an existing file name & extension in your organization.
    • Currently, we only support these file extensions: .pdf, .png, .jpg, .jpeg, .zip.
    • The session link will be expired in 10 minutes. File Upload Session
  2. Write a script using the Upload File API to upload your file to our system. The URL of this API should be the link in the uploadSession field at step 1.

    In the request body of this API, please use the form-data format (not JSON format), add a file key and its value is your file. Then copy the value in the fileId field from the response body to use in the Metadata API.

    NOTE:

    • Please ensure that the selected file name & extension in the value is the same with the request data from step 1. If not, you will get an error message.
    • You also cannot upload a file to the Inspectorio system if your file is bigger than 300 MB, or your session link is expired. Upload File
  3. Write a script using the Create Metadata API with the corresponding namespace (For example, use the inspection namespace if you want to attach your file to the Inspection page).

    The Metadata API allows you to integrate the dynamic attributes to the Inspectorio system. However, we have some key fields that you will need to follow to make sure your data displays to the correct feature on the Sight platform. Please contact with your Inspectorio Account Manager to ask more details about your expected integration feature.

    In general, to attach the uploaded file to a Sight feature, you can add a field with type is file and the value is the fileId value from step 2. Create Metadata

Where can we see the integrated file(s) on the Sight platform ?

  1. Files integrated via API are only visible when Questionnaires are configured in the Inspection booking form.
  2. Check out the following resources for more details:

Please contact with your Inspectorio Account Manager to get more detailed information.