Introduction
The Document API provides mechanisms to upload and manage files in Performio.
Document Resources
Import Files
Import Files are wrappers around uploaded files that are to be imported into Performio via an Import File Type (Standard or Custom). Once created, an Import File coupled with an Import File Type can be used to create an Import Errand, which will trigger the actual import of data.
POST /zuul/document/v1/import-files
Please note the /zuul prefix for this endpoint. If you do not provide it, your file upload will fail. |
Utilise this endpoint to create an Import File by uploading a file.
Requests are multipart form data (multipart/form-data). Responses are JSON (application/json).
Request
$ curl 'https://gateway-domain.performio.co/gateway/zuul/document/v1/import-files' -i -X POST \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
-F 'file=@/path/document-to-upload.json' \
-F 'filename=test-file.json' \
-F 'skipMD5=true' \
-F 'errandId=1'
Headers
Name | Description |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Part | Description |
---|---|
|
Object representing the multipart file to be uploaded. |
Parameter | Description |
---|---|
|
Boolean representing whether to skip MD5 digest generation for the Import File. |
|
(Optional) String representing an override for the uploaded file’s filename. |
|
(Optional) Number representing the ID of a pre-created Import Errand. If provided, the Import File will be processed immediately. |
Response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 243
{
"id" : 1,
"filename" : "ParticipantSourceData.xlsx",
"fileSize" : 22800082,
"uploadedTimestamp" : 1539922402211,
"md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
"type" : null,
"imported" : false,
"duplicateUpload" : false
}
Path | Type | Description |
---|---|---|
|
|
Number representing the ID of the Import File. Utilised when creating Import Errands to indicate which Import File to import. |
|
|
String representing the filename of Import File. |
|
|
Number representing the file size Import File in bytes |
|
|
Number representing the timestamp for when the Import File was uploaded. |
|
|
String representing an MD5 digest of the uploaded file, Null if skipMD5 set to true in during upload. |
|
|
String representing the Import File Type if the Import File has been imported, Null if it has not been imported. |
|
|
Boolean representing if the Import File has been imported. |
|
|
Boolean representing if the the Import File is a duplicate of another Import File. |
Error Conditions
|
|
A required parameter is missing from the request. |
|
Errand ID provided does not resolve to an Import Errand. |
|
Due to an internal issue with file storage the uploaded file could not be saved. |
|
GET /document/v1/import-files
Utilise this endpoint to retrieve all Import Files. Results are paginated.
Responses are JSON (application/json).
Request
$ curl 'https://gateway-domain.performio.co/gateway/document/v1/import-files?page=0&size=20' -i -X GET \
-H 'Accept: application/json' \
-H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'
Headers
Name | Description |
---|---|
|
OAuth 2.0 authentication token |
Request Parameters
Parameter | Description |
---|---|
|
(Optional) Number representing the page to retrieve. Pages start from 0. |
|
(Optional) Number representing the records per page count. Default page size is 20 and the maximum is 2000. |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 633
{
"results" : [ {
"id" : 1,
"filename" : "ParticipantSourceData.xlsx",
"fileSize" : 22800082,
"uploadedTimestamp" : 1539922402211,
"md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
"type" : null,
"imported" : false,
"duplicateUpload" : false
}, {
"id" : 2,
"filename" : "ParticipantSourceData.xlsx",
"fileSize" : 22800082,
"uploadedTimestamp" : 1539922402211,
"md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
"type" : null,
"imported" : false,
"duplicateUpload" : false
} ],
"page" : {
"totalPages" : 1,
"totalElements" : 2,
"hasNext" : false
}
}
Path | Type | Description |
---|---|---|
|
|
Number representing the ID of the Import File. Utilised when creating Import Errands to indicate which Import File to import. |
|
|
String representing the filename of Import File. |
|
|
Number representing the file size Import File in bytes |
|
|
Number representing the timestamp for when the Import File was uploaded. |
|
|
String representing an MD5 digest of the uploaded file, Null if skipMD5 set to true in during upload. |
|
|
String representing the Import File Type if the Import File has been imported, Null if it has not been imported. |
|
|
Boolean representing if the Import File has been imported. |
|
|
Boolean representing if the the Import File is a duplicate of another Import File. |
|
|
Object representing result pagination. |
|
|
Number representing the total pages at current page size. |
|
|
Number representing the total possible elements for the request. |
|
|
Boolean representing if there is a next page of results. |
GET /document/v1/import-files/{importFileId}
Utilise this endpoint to retrieve a specific Import File.
Responses are JSON (application/json).
Request
$ curl 'https://gateway-domain.performio.co/gateway/document/v1/import-files/1' -i -X GET \
-H 'Accept: application/json' \
-H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'
Headers
Name | Description |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
Number representing the ID of the Import File to fetch. |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 243
{
"id" : 1,
"filename" : "ParticipantSourceData.xlsx",
"fileSize" : 22800082,
"uploadedTimestamp" : 1539922402211,
"md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
"type" : null,
"imported" : false,
"duplicateUpload" : false
}
Path | Type | Description |
---|---|---|
|
|
Number representing the ID of the Import File. Utilised when creating Import Errands to indicate which Import File to import. |
|
|
String representing the filename of Import File. |
|
|
Number representing the file size Import File in bytes |
|
|
Number representing the timestamp for when the Import File was uploaded. |
|
|
String representing an MD5 digest of the uploaded file, Null if skipMD5 set to true in during upload. |
|
|
String representing the Import File Type if the Import File has been imported, Null if it has not been imported. |
|
|
Boolean representing if the Import File has been imported. |
|
|
Boolean representing if the the Import File is a duplicate of another Import File. |
Error Conditions
|
|
Import File ID provided does not resolve to an Import File. |
|
GET /document/v1/import-files/{importFileId}/contents
Utilise this endpoint to retrieve the contents of a specific Import File.
Responses are streamed (application/octet-stream).
Request
$ curl 'https://gateway-domain.performio.co/gateway/document/v1/import-files/1/contents' -i -X GET \
-H 'Accept: application/octet-stream' \
-H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'
Headers
Name | Description |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
Number representing the ID of the Import File to fetch. |
Response
HTTP/1.1 200 OK
Content-Length: 115
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="ParticipantSourceData.xlsx"
Accept-Ranges: bytes
participant, period, client, total
exampleUser, 1, acme, 1000
exampleUser, 2, acme, 1500
exampleUser, 3, acme, 1200