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.

POST

https://api.anaplan.com/2/0/workspaces/{workspaceID}/models/{modelID}/files/{fileID}

ParameterDescription
AnaplanAuthToken:{token}Your Anaplan authentication token value.
content typeSet to Content-Type:application/json
fileIDThe file ID obtained previously.
file nameThe name of the file.
chunkCountThe number of chunks in the file.  Set to -1.
firstDataRowThe 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'.
headerRowThe header row in the file.  If the first line in your file is the header row, set this to '1'.

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/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"

   }

}