Create an upload
POST
/uploadCreates a new upload
Example
Section titled “Example”Use resource IDs from your own project. Keep the API token in your server or CI environment.
import { createConfiguration, UploadsApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);const api = new UploadsApi(config);
const result = await api.createUpload({ "files": new File(['Test evidence'], 'evidence.txt', { type: 'text/plain' }), "company": 123});console.log(result);curl --request POST \ "https://api.testcollab.io/upload?token=$TESTCOLLAB_TOKEN" --form 'files=@./evidence.txt' --form 'company=123'Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
files |
string | Yes | — |
company |
number | Yes | Company ID |
Response
Section titled “Response”200 — Created Upload
| Field | Type | Required | Description |
|---|---|---|---|
[].id |
number | Yes | — |
[].name |
string | Yes | — |
[].hash |
string | Yes | — |
[].ext |
string | Yes | — |
[].mime |
string | Yes | — |
[].size |
string | Yes | — |
[].url |
string | Yes | — |
[].created_by |
number | No | — |
[].created_at |
string | Yes | — |
[].updated_at |
string | Yes | — |
[]Errors
Section titled “Errors”| Status | Meaning |
|---|---|
403 |
Forbidden |