Data Factory File API
Introduction
A Data Factory File is a file generated by a Data Factory task. Or a file used as an input by a Data Factory task.
The Data Factory Files API Swagger definition is available on our Product-Live API portal here.
General information
- Maximum file size is set to 100MB. If you need to upload larger files, please contact our support team.
- A Data Factory file has a limited lifetime. It is automatically deleted after 90 days.
- Rate limit: 50 requests per minute
Upload a Data Factory File
TIP
- File size limit: 100MB
Request URL
Path parameters
None
Request parameters
None
Request Headers
Header | Type | Description |
---|---|---|
Content-Type | string | multipart/form-data |
accept | string | */* |
X-Api-Key | string | Your account API key |
Request Body
Body | Type | Description |
---|---|---|
form-data | file | A file |
Request Example
bash
curl -X 'POST' \
'https://api.product-live.com/v1/data_factory/files' \
-H 'accept: */*' \
-H 'X-Api-Key: <REDACTED>' \
-H 'Content-Type: multipart/form-data' \
-F 'file=table-import-schema.xml'
1
2
3
4
5
6
2
3
4
5
6
ts
import { createConfiguration, ServerConfiguration, DataFactoryFileApi } from '@product-live/api-sdk';
import { promises as fs } from 'fs';
import path from 'path';
export async function main(): Promise<void> {
const filePath = 'file path';
const configuration = createConfiguration({
baseServer: new ServerConfiguration(process.env.API_BASE_PATH || '', {}),
authMethods: {
ApiKeyAuthHeader: process.env.API_ACCESS_TOKEN
}
});
const dataFactoryFileApi = new DataFactoryFileApi(configuration);
await dataFactoryFileApi.uploadFile({
data: Buffer.from(await fs.readFile(filePath, 'utf-8')),
name: path.basename(filePath)
});
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Response Example
json
{
"object": "data_factory_file",
"id": "70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be",
"createdAt": "2020-01-01T12:00:00.000Z",
"updatedAt": "2020-01-01T12:00:00.000Z",
"url": "http://api.product-live.com/v1/data_factory/files/70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be/content",
"filename": "table-import-schema.xml"
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Get a Data Factory File by Id
Request URL
Path parameters
Parameter | Type | Description |
---|---|---|
fileId | string | Required A Data Factory file id |
Request parameters
None
Request Headers
Header | Type | Description |
---|---|---|
accept | string | */* |
X-Api-Key | string | Your account API key |
Request Body
None
Request Example
bash
curl -X 'GET' \
'https://api.product-live.com/v1/data_factory/files/70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be' \
-H 'accept: */*' \
-H 'X-Api-Key: <REDACTED>'
1
2
3
4
2
3
4
ts
import { createConfiguration, ServerConfiguration, DataFactoryFileApi } from '@product-live/api-sdk';
export async function main(): Promise<void> {
const configuration = createConfiguration({
baseServer: new ServerConfiguration(process.env.API_BASE_PATH || '', {}),
authMethods: {
ApiKeyAuthHeader: process.env.API_ACCESS_TOKEN
}
});
const dataFactoryFileApi = new DataFactoryFileApi(configuration);
const dataFactoryFile = await dataFactoryFileApi.getFileById('file id');
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
Response Example
json
{
"object": "data_factory_file",
"id": "70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be",
"createdAt": "2020-01-01T12:00:00.000Z",
"updatedAt": "2020-01-02T12:00:00.000Z",
"url": "http://api.product-live.com/v1/data_factory/files/70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be/content",
"filename": "table-import-schema.xml"
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
List Data Factory Files
Request URL
Path parameters
None
Request parameters
Parameter | Type | Description |
---|---|---|
page | integer | Optional The page number to retrieve. Default value if missing : 0 |
size | integer | Optional The number of items per page. Default value if missing : 10 |
Request Headers
Header | Type | Description |
---|---|---|
accept | string | */* |
X-Api-Key | string | Your account API key |
Request Body
None
Request Example
bash
curl -X 'GET' \
'https://api.product-live.com/v1/data_factory/files?size=10&page=0' \
-H 'accept: */*' \
-H 'X-Api-Key: <REDACTED>'
1
2
3
4
2
3
4
ts
import { createConfiguration, ServerConfiguration, DataFactoryFileApi } from '@product-live/api-sdk';
export async function main(): Promise<void> {
const configuration = createConfiguration({
baseServer: new ServerConfiguration(process.env.API_BASE_PATH || '', {}),
authMethods: {
ApiKeyAuthHeader: process.env.API_ACCESS_TOKEN
}
});
const dataFactoryFileApi = new DataFactoryFileApi(configuration);
const dataFactoryFiles = await dataFactoryFileApi.getFiles()
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
Response Example
json
{
"object": "list",
"totalElements": 1,
"data": [
{
"object": "data_factory_file",
"id": "70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be",
"createdAt": "2020-01-01T12:00:00.000Z",
"updatedAt": "2020-01-02T12:00:00.000Z",
"url": "http://api.product-live.com/v1/data_factory/files/70923562084497906fe165aa6ff2629f2d1e61d39d3e017709f7ac7722ddd2be/content",
"filename": "table-import-schema.xml"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14