Set the chunk count to use for chunking.
This prepares Anaplan to receive the file in one or more parts and supports reliable transfer of larger files.
Use chunking:
- If you want to be able to resume the transfer after the connection is lost during an upload.
- If you are extracting data from a database and want to push it to the server without holding all the results in memory.
To avoid consuming large amounts of memory on the server, a chunk is expected to be between 1 and 50 MB. The chunk count might change if the file to upload has become larger or smaller than the server's version of that file:
idis the ID of the file for which the chunk count is to be updated.nameis the filename of the file.chunkCountis the number of chunks in the file.delimiteris double-quotes for columns and fields. For example, "Versions","Opportunities"," "Version 1","Opportunity 0001".encodingdetermines the way in which bytes in a file map to Unicode character code points. See Common Character Encodings on Wikipedia.firstDataRowis the first row after the row containing column names.formatis text, as opposed to a binary stream.headerRowis the row that contains column names.separatoris the token that separates fields. This is typically a comma, for example, "Versions","Opportunities"," "Version 1","Opportunity 0001".
Method and endpoint
/workspaces/{workspaceId}/models/{modelId}/files/{fileId}
Parameters
| Parameter | Description |
workspaceId |
|
modelId |
|
fileId |
|
Curl Example
curl -X POST \
https://api.anaplan.com/2/0/workspaces/{workspaceId}/models/{modelId}/files/{fileId} \
-H 'Authorization: AnaplanAuthToken auth_token' \
-H 'Content-Type: application/json' \
-d '{"chunkCount":1}'
Response
Response 200 (application/json)
{
"meta": {
"schema": "https://api.anaplan.com/2/0/models/75A40874E6B64FA3AE0743278996850F/objects/file"
},
"status": {
"code": 200,
"message": "Success"
},
"file": {
"id": "113000000008",
"name": "Tests.txt",
"chunkCount": 1,
"delimiter": "\"",
"encoding": "ISO-8859-1",
"firstDataRow": 2,
"format": "txt",
"headerRow": 1,
"separator": "\t"
}
}