File Management

Read File

Introduction

If a ReadSingleFileRequest is passed, reads that file from the project. If a ReadAllFilesRequest is passed, reads all files in the project.

Request

An array list of files from the project requested. The /files/read API accepts requests in the following format:

ReadFilesRequest Model - Request to read all files from a project or just one (if the name is provided).
projectId integer
Project Id to which the file belongs.
name string
Optional. The name of the file that will be read.
Example
{
  "projectId": 0,
  "name": "string"
}

Responses

The /files/read 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": [
    {
      "id": ,
      "projectId": ,
      "name": "string",
      "content": "string",
      "modified": "2021-11-26T15:18:27.693Z",
      "open": true,
      "isLibrary": true
    }
  ],
  "success": true,
  "errors": [
    "string"
  ]
}
ProjectFile Model - File for a project.
id int
ID of the project file. This can also be null.
projectId int
ID of the project.
name string
Name of a project file.
content string
Contents of the project file.
modified string($date-time)
DateTime project file was modified.
open boolean
Indicates if the project file is open or not.
isLibrary boolean
Indicates if the project file is a library or not. It's always false in live/read and backtest/read.
Example
{
  "id": ,
  "projectId": ,
  "name": "string",
  "content": "string",
  "modified": "2021-11-26T15:18:27.693Z",
  "open": true,
  "isLibrary": true
}

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: