Creating a new file with Document API

To create a new file with Document API:

  1. Sign in to the Developer Portal.

  2. Go to APIs and click document API - v2. The document API page opens.

  3. From the list of API calls select Creates the specified file and content, including optional folder hierarchy. Then click Try it.

  4. Scroll down to Body and populate the fields with your values:

    1. filePath: Put in your file path.

      Important! File path name must be a full path and file name, for example: /Project/Files/MyFile.txt
    2. content: If you don't provide data for the file, your file will be empty. To save data in your file, provide base64-encoded data in the content field. To create an empty file, delete the content field from Body.

    3. thumbnail: Provide a thumbnail image to be displayed in Documents in Control Center. If you don't want to provide your thumbnail, delete the thumbnail field from Body.

    4. comment: optional for the first revision. For other revisions, populate this field.

  5. Delete the lines for any skipped fields.

  6. Scroll down and click Send.

If your result is a 201 Created response, the API call was successful.

Note: In this API call, we created a file in a workflow-enabled folder. If you don't have workflow enabled or create a file where workflow isn't enabled, you won't see workflow-related content in your API response. See more about Workflows in Loftware Cloud.