Skip to content

API upload routes

AyaNova has several API routes for uploading files.

These routes are all POST routes:

  • /api/v{version}/attachment
  • /api/v{version}/import
  • /api/v{version}/logo

Upload routes are not testable from the API explorer console.

Upload routes expect a form to be uploaded with file content disposition (multipart/form-data).

AyaNova limits the size of files uploaded to each of the upload routes documented in the API explorer console comments with those routes.

Here is a sample minimal HTML form that works with AyaNova file routes:

<!DOCTYPE html>
    <meta charset="utf-8" />
    <script type="text/javascript">
      $(document).ready(function () {
        $("#upload").click(function (evt) {
          var fileUpload = $("#files").get(0);
          var files = fileUpload.files;
          var data = new FormData();
          for (var i = 0; i < files.length; i++) {
            data.append(files[i].name, files[i]);

          //Attachment upload route requires further form data to designate
          //the object being attached to by it's type and id:

            type: "POST",
            url: "http://yourserver:7575/api/v8.0/attachment",
            headers: {
              Authorization: "Bearer JWTTokenHere"
            contentType: false,
            processData: false,
            data: data,
            success: function (message) {
              alert("upload successful!");
            error: function (error) {
              alert("There was an error uploading files!");

    <form method="post" enctype="multipart/form-data">
      <input type="file" id="files" name="files" multiple />
      <input type="button" id="upload" value="Upload file(s)" />