When you import a file in chunks, you need to tell the API what to expect in terms of the number of chunks in a file.
We recommend you set the chunk count to -1 rather than specifying the exact count. You will later send a call to mark the upload as complete. This API call requires the file ID you obtained in the Get the list of files step.
Method and endpoint
https://api.anaplan.com/2/0/workspaces/{workspaceID}/models/{modelID}/files/{fileID}
Parameters
Parameter | Description |
AnaplanAuthToken:{token} | Your Anaplan authentication token value. |
content type | Set to Content-Type:application/json |
fileID | The file ID obtained previously. |
file name | The name of the file. |
chunkCount | The number of chunks in the file. Set to -1. |
firstDataRow | The first data row in the file. If the first data row in your file is the second row (other than the header), set to '2'. |
headerRow | The header row in the file. If the first line in your file is the header row, set this to '1'. |
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
{
"meta":{
"schema":"https://api.anaplan.com/2/0/models/F1111111C11111111B11111F1111E11F/objects/file"
},
"status":{
"code":200,
"message":"Success"
},
"file":{
"id":"113000000000",
"name":"Organization.txt",
"chunkCount":0,
"delimiter":"\"",
"encoding":"ISO-8859-1",
"firstDataRow":2,
"format":"txt",
"headerRow":1,
"separator":"\t"
}
}