Description
See the External Web Services for method, token, and responseType usage and error messages.
API archivefiles allows user to search for available files in a station and download the file.
...
Method | Description | Example |
---|---|---|
getList* | Get a list of files for a given station, and filtered by others optional parameters. | method=getList |
getListByLocation | Get a list of files for a given location code and device category code, and filtered by others optional parameters. | method=getListByLocation |
getListByDevice | Get a list of files for a given device code, and filtered by others optional parameters. | method=getListByDevice |
getFile | Download a file from DMAS Archiving System by specifying the file name. | method=getFile |
*getList is still available but is deprecated as of April 1, 2017. It has been replaced by the getListByLocation method.
Anchor | ||||
---|---|---|---|---|
|
Get a list of files available in DMAS Oceans 2.0 Archiving System for a given station. The list of filenames can be filtered by device category and time range.
...
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
station | string | Station code defined by DMAS. | |
token | string | Credential token. | |
Optional | |||
deviceCategory | string | Device category code defined by DMAS. | |
dateFrom | date | The date (in "yyyy-MM-ddTHH:mm:ss.SSSZ" format). | 2010-02-15T00:00:00.000Z |
dateTo | date | The date (in "yyyy-MM-ddTHH:mm:ss.SSSZ" format). | 2010-03-15T18:00:00.000Z |
dateArchivedFrom | date | The date (in "yyyy-MM-ddTHH:mm:ss.SSSZ" format). | 2010-04-15T00:00:00.000Z |
dateArchivedTo | date | The date (in "yyyy-MM-ddTHH:mm:ss.SSSZ" format). | 2010-07-15T22:30:00.000Z |
returnOptions | string | If there is no value given, only a list of filenames will be returned. If the value is "archiveLocation" a list of filenames with their archiveLocation will be returned. If the value is "all" there are more metadata information will be returned.
| all |
rowLimit | integer | The maximum number of data to return, within the constraints of the service. Note this will limit the data starting at the dateFrom time and ending at the row limit, not necessarily at the dateTo time. default row limit: 100000 | rowLimit=100 |
returnserviceMetadatareturnServiceMetadata | string | if it is true, the service will return all the input parameters with an additional information to indicate the next start index | returnserviceMetadatareturnServiceMetadata=true |
startIndex | integer | This only works if returnserviceMetadatareturnServiceMetadata=true. The service will return data starting from the startIndex. It is useful for client code to create a loop.
| startIndex = 100 |
...
HTTP status code 200 will be returned in HTTP header.
If "returnserviceMetadatareturnServiceMetadata" is NOT set to "true" and if "returnOption" parameter is "all", a list of file names with their metadata information will be returned.
...
Property | Type | Description | Example |
---|---|---|---|
archivedDate | date | The time stamp of current file in AD while it is archived | 2010-04-21T00:00:00.000Z |
compressedSize | long | File size, in bytes, after compressed with GZip | |
compression | string | The file extension if the file is compressed | gz |
dataProductFormatId | integer | Data product format ID | 8 |
dateFrom | date | The beginning time stamp the data is recorded in the file | 2010-04-21T00:00:00.000Z |
dateModified | date | The last time stamp of any modification related to the file | 2010-04-22T01:55:00.000Z |
dateTo | date | The end time stamp the data is recorded in the file | 2010-04-22T00:00:00.000Z |
deviceId | integer | Device ID | |
filename | string | The name of the file | |
uncompressedSize | long | Original file size, in bytes, without compressed |
If "returnserviceMetadatareturnServiceMetadata" is NOT set to "true" and if "returnOptions" parameter is NOT set, only a list of file names will be returned in JSON array object.
Code Block |
---|
[ <string>, <string> ] |
If "returnserviceMetadatareturnServiceMetadata" is set to "true" and if "returnOption" parameter is "all", a list of file names with their metadata information will be returned.
...
Property | Type | Description | Example |
---|---|---|---|
files.archivedDate | date | The time stamp of current file in AD while it is archived | 2010-04-21T00:00:00.000Z |
files.compressedSize | long | File size, in bytes, after compressed with GZip | |
files.compression | string | The file extension if the file is compressed | gz |
files.dataProductFormatId | integer | Data product format ID | 8 |
files.dateFrom | date | The beginning time stamp the data is recorded in the file | 2010-04-21T00:00:00.000Z |
files.dateModified | date | The last time stamp of any modification related to the file | 2010-04-22T01:55:00.000Z |
files.dateTo | date | The end time stamp the data is recorded in the file | 2010-04-22T00:00:00.000Z |
files.deviceId | integer | Device ID | |
files.filename | string | The name of the file | |
files.uncompressedSize | long | Original file size, in bytes, without compressed | |
serviceMetadata.dateArchivedFrom | date | returned input parameter | |
serviceMetadata.dateArchivedTo | date | returned input parameter | |
serviceMetadata.dateFrom | date | returned input parameter | |
serviceMetadata.dateTo | date | returned input parameter | |
serviceMetadata.deviceCategory | string | returned input parameter | |
serviceMetadata.returnOptions | string | returned input parameter | |
serviceMetadata.rowLimit | integer | returned input parameter | |
serviceMetadata.startIndex | integer | the start index for next call. -1 means there is no any data for next call | |
serviceMetadata.station | string | returned input parameter |
If "returnserviceMetadatareturnServiceMetadata" is set to "true" and if "returnOptions" parameter is NOT set, only a list of file names will be returned in JSON array object.
...
https://data.oceannetworks.ca/apiproxy/archivefiles?method=getList&station=BACHY&returnserviceMetadatareturnServiceMetadata=true&rowLimit=5&startIndex=10&returnOptions=all
...
https://data.oceannetworks.ca/apiproxy/archivefiles?method=getList&station=BACHY&returnserviceMetadatareturnServiceMetadata=true&rowLimit=5
Code Block |
---|
{ "files": [ { "archivedDate":"2013-09-20T18:05:59.000Z", "compression":"gz", "dataProductFormatId":5, "dateFrom":"2009-09-02T00:00:00.000Z", "dateTo":"2009-09-03T00:00:00.000Z", "deviceId":10002, "fileSize":815980, "filename":"BC_MC_PJB_20090902T000000.000Z.txt", "modifyDate":"2015-01-07T23:51:17.000Z", "uncompressedFileSize":20772075 }, ... ], "serviceMetadata": { "dateArchivedFrom":null, "dateArchivedTo":null, "dateFrom":null, "dateTo":null, "deviceCategory":"", "returnOptions":"all", "rowLimit":5, "startIndex":15, "station":"BACHY" } } { "files": [ "AGOTEMP02_20110713T000000.000Z.txt", "AGOTEMP02_20110714T000000.000Z.txt", "AGOTEMP02_20110715T000000.000Z.txt", "BC_MC_PJB_20090801T000000.000Z.txt", "BC_MC_PJB_20090802T000000.000Z.txt" ], "serviceMetadata": { "dateArchivedFrom":null, "dateArchivedTo":null, "dateFrom":null, "dateTo":null, "deviceCategory":"", "returnOptions":"all", "rowLimit":5, "startIndex":5, "station":"BACHY" } } |
...
Get a list of files available in DMAS Oceans 2.0 Archiving System for a given location code and device category code. The list of filenames can be filtered by time range.
...
Get a list of files available in DMAS Oceans 2.0 Archiving System for a given device code. The list of filenames can be filtered by time range.
...
Anchor | ||||
---|---|---|---|---|
|
Download a file from DMAS Oceans 2.0 Archiving System by specifying the file name. The file will be downloaded without any compression.
...