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:

  • id is the ID of the file for which the chunk count is to be updated.
  • name is the filename of the file.
  • chunkCount is the number of chunks in the file.
  • delimiter is double-quotes for columns and fields. For example, "Versions","Opportunities"," "Version 1","Opportunity 0001".
  • encoding determines the way in which bytes in a file map to Unicode character code points. See Common Character Encodings on Wikipedia.
  • firstDataRow is the first row after the row containing column names.
  • format is text, as opposed to a binary stream.
  • headerRow is the row that contains column names.
  • separator is the token that separates fields. This is typically a comma, for example, "Versions","Opportunities"," "Version 1","Opportunity 0001".
POST

/workspaces/{workspaceId}/models/{modelId}/files/{fileId}

ParameterDescription
workspaceId
  • Required
  • Type: string
  • Description: The workspace ID
  • Example: 8a8b8c8d8e8f8g8i
modelId
  • Required
  • Type: string
  • Description: The model ID
  • Example: FC12345678912343455667
fileId
  • Required
  • Type: number
  • Description: The file ID
  • Example: 113000000008

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}'

{
  "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"
  }
}