To download a file, you must first find the file ID using the search API.
Search files within a given group.
GET https://api.data.xpansiv.com/file/search?size=<size>&from=<from>&query=<value>
curl "https://api.data.xpansiv.com/file/search?query=groupName%3D<groupName>"{
"from": 0,
"totalSize": 4,
"files": [
{
"fileName": "file name",
"fileType": "file type [SOURCE|NCSV|DOWNLOADER|DATA_PREP|GDP]",
"groupName": "group name",
"fid": "file id",
"fields": {
"text": "some text"
},
"arrivalTime": "2018-01-01T12:00:00",
"owner": "file owner",
"size": 100
}
]
}| Parameter | Description |
|---|---|
| size | Optional. Max size of returned hits list. Default is 100. Max is 1000. |
| from | Optional. Index of the first hit for paging. Default is 0. |
| query | Value of the metadata field to look for. Must be URL encoded. |
Download the contents of a given file ID.
GET https://api.data.xpansiv.com/file/<fileId>/download
curl "https://api.data.xpansiv.com/file/<fileId>/download"| Parameter | Description |
|---|---|
| fileId | The ID of the file to download |
The response is the file's content.
Retrieve metadata of a specific file. The response headers include a presigned URL valid for one hour to download the file.
GET https://api.data.xpansiv.com/file/<fileId>
curl "https://api.data.xpansiv.com/file/<fileId>"Use the presigned URL from the Location header to download the file:
curl -X GET "LocationURL"{
"fileName": "file name",
"fileType": "file type [SOURCE|NCSV]",
"groupName": "group name",
"fid": "file id",
"fields": {
"fieldName": "field value"
},
"arrivalTime": "2018-01-01T12:00:00",
"owner": "file owner",
"size": 0
}- fileName: File name
- fileType: File type [SOURCE, NCSV]
- groupName: Group name
- fid: File ID
- fields: Metadata map
- arrivalTime: Upload date
- owner: User who uploaded the file
- size: Size in bytes
Search files with metadata field1=value1 and return first 10 hits.
curl "https://api.data.xpansiv.com/file/search?size=10&from=0&query=value1"{
"from": 0,
"totalSize": 4,
"files": [
{
"fileName": "file name",
"fileType": "file type [SOURCE|NCSV|DOWNLOADER|DATA_PREP|GDP]",
"groupName": "group name",
"fid": "file id",
"fields": {
"text": "some text"
},
"arrivalTime": "2018-01-01T12:00:00",
"owner": "file owner",
"size": 100
}
]
}Search files using a regular expression.
GET https://api.data.xpansiv.com/file/search/regexp?size=<size>&from=<from>&query=<value>
curl "https://api.data.xpansiv.com/file/search/regexp?size=10&from=0&query=value1" -H "Authorization: Bearer yourNgToken"{
"from": 0,
"totalSize": 4,
"files": [
{
"fileName": "file name",
"fileType": "file type [SOURCE|NCSV|DOWNLOADER|DATA_PREP|GDP]",
"groupName": "group name",
"fid": "file id",
"fields": {
"text": "some text"
},
"arrivalTime": "2018-01-01T12:00:00",
"owner": "file owner",
"size": 100
}
]
}