File Management

Create File

Introduction

Add a file to given project.

Request

Project, file name and file content to create. The /files/create API accepts requests in the following format:

CreateProjectFileRequest Model - Request to add a file to a project.
projectId integer
Project id to which the file belongs.
name string
example: main.py

The name of the new file.
content string
The content of the new file.
Example
{
  "projectId": 0,
  "name": "main.py",
  "content": "string"
}

Responses

The /files/create API provides a response in the following format:

200 Success

ProjectFilesResponse Model - Response received when reading files from a project.
files ProjectFile Array
List of project file information.
success boolean
Indicate if the API request was successful.
errors string Array
List of errors with the API call.
Example
{
  "files": [
    {
      "name": "string",
      "content": "string",
      "modified": "2021-11-26T15:18:27.693Z"
    }
  ],
  "success": true,
  "errors": [
    "string"
  ]
}
ProjectFile Model - File for a project.
name string
Name of a project file.
content string
Contents of the project file.
modified string($date-time)
DateTime project file was modified.
Example
{
  "name": "string",
  "content": "string",
  "modified": "2021-11-26T15:18:27.693Z"
}

401 Authentication Error

UnauthorizedError Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.
www_authenticate string
Header

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: