API archivefiles allows user to search for available files in a station and download the file.
https://data.oceannetworks.ca/api/archivefiles |
Method | Description | Example |
---|---|---|
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 |
Get a list of files available in Oceans 3.0 Archiving System for a given location code and device category code. The list of filenames can be filtered by time range.
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | string | All Web Services require a token. This can be generated at https://data.oceannetworks.ca/Profile. Click on the "Web Services" tab and click "Generate Token". | token=YOUR_TOKEN_HERE |
locationCode | string | Return a list of files from a specific Location.
| locationCode=BACUS |
deviceCategoryCode | string | Return a list of files of a specific Device Category Code.
| deviceCategoryCode=JB |
Optional | |||
dateFrom | date | Return files that have a timestamp on or after a specific date/time. Accepted DateTime formats:
If not specified, the default value is the beginning of time.
| dateFrom=2010-07-27T00:00:00.000Z dateFrom=2010-07-27 dateFrom=-P1DT1H
|
dateTo | date | Return files that have a timestamp before a specific date/time. Accepted DateTime formats:
If not specified, the default value is the end of time.
| dateTo=2016-08-01T00:00:00.000Z dateTo=2016-08-01 dateTo=PT12H30M
|
dateArchivedFrom | date | Return files archived on or after a specific date/time. Accepted DateTime formats:
If not specified, the default value is the beginning of time.
| dateArchivedFrom=2010-07-27T00:00:00.000Z dateArchivedFrom=2010-07-27 dateArchivedFrom=-P1DT1H
|
dateArchivedTo | date | Return files archived before a specific date/time. Accepted DateTime formats:
If not specified, the default value is the end of time.
| dateArchivedTo=2016-08-01T00:00:00.000Z dateArchivedTo=2016-08-01 dateArchivedTo=PT12H30M
|
fileExtension | String | Return files of a specific File Extension.
| png |
dataProductCode | String | Return files of a specific Data Product Code.
| HSD |
returnOptions | string | If there is no value given, list of filenames will be returned. If the value is "archiveLocation" a list of filenames with their archiveLocation will be returned. Mostly used by www.oceannetworks.ca website. If the value is "all" , more metadata information will be returned. *All results returned with serviceMetadata object. | returnOptions=archiveLocation |
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 |
page | integer | The service will return data starting from a certain page. By default this value is 1. If the data size is greater than rowLimit, results will be split into pages where each page contains at most rowLimit number of data. This parameter is used to generate serviceMetadata.next parameter, which can be used to get the next set of data. | page=1 |
getLatest | boolean | Specifies whether or not the latest raw data readings should be returned first. This is false by default. When set to true, readings are returned and pagination is done from latest to earliest. | getLatest=true |
HTTP status code 200 will be returned in HTTP header.
If "returnOption" parameter is "all", a list of file names with their metadata information will be returned.
{ "files": [ { "archivedDate": <date>, "compression": <string>, "dataProductCode": <string>, "dateFrom": <date>, "dateTo": <date>, "deviceCode":<string>, "fileSize": <long>, "filename": <string>, "modifyDate": <date>, "uncompressedFileSize": <long> }, ], "serviceMetadata": { "dateArchivedFrom":<date>, "dateArchivedTo":<date>, "dateFrom":<date>, "dateTo":<date>, "deviceCategoryCode":<string>, "returnOptions":<string>, "rowLimit":<integer>, "page":<integer>, "locationCode":<string> } } |
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.dataProductCode | string | Data product code | 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.deviceCode | string | Device Code | |
files.filename | string | The name of the file | "BC_POD2_JB_20090908T000000.000Z.txt" |
files.uncompressedSize | long | Original file size, in bytes, without compressed | 156545 |
serviceMetadata.dateArchivedFrom | date | As passed into the original call | |
serviceMetadata.dateArchivedTo | date | As passed into the original call | |
serviceMetadata.dateFrom | date | As passed into the original call | |
serviceMetadata.dateTo | date | As passed into the original call | |
serviceMetadata.deviceCategoryCode | string | As passed into the original call | "JB" |
serviceMetadata.returnOptions | string | As passed into the original call | |
serviceMetadata.rowLimit | integer | As passed into the original call | 5 |
serviceMetadata.next | Object | An object containing information for the next service call if the current call was unable to return all the data due to limit restrictions. This is null if there is no more data in the requested range. | |
| Object | An object containing the set of parameters making up the query to get the next set of data in the requested date range. The parameters will include all parameters passed into the original URL. | |
| String | As passed into the original call | "JB" |
| String | As passed into the original call | "getListByLocation" |
| String | As passed into the original call | "archiveLocation" |
| integer | As passed into the original call | 5 |
| integer | The page index for next call | 1 |
| String | As passed into the original call | "BACUS" |
| String | As passed into the original call | "YOUR_TOKEN_HERE" |
| String | The complete URL that can be used to get the next set of data in the requested range. | |
serviceMetadata.page | integer | The page index for next call. 1 means all results are returned and there is no more data | |
serviceMetadata.locationCode | string | As passed into the original call |
{ "files":[ "BC_POD2_JB_20090908T000000.000Z.txt", "BC_POD2_JB_20090909T000000.000Z.txt", "BC_POD2_JB_20090916T000000.000Z.txt", "BC_POD2_JB_20090925T000000.000Z.txt", "BC_POD2_JB_20090926T000000.000Z.txt" ], "serviceMetadata":{ "dateArchivedFrom":null, "dateArchivedTo":null, "dateFrom":null, "dateTo":null, "deviceCategoryCode":"JB", "locationCode":"BACUS", "next":{ "parameters":{ "method":"getListByLocation", "rowLimit":"5", "page":"2", "locationCode":"BACUS", "deviceCategoryCode":"JB", "token":"YOUR_TOKEN_HERE" }, "url":"https://data.oceannetworks.ca/api/archivefiles?method=getListByLocation&rowLimit=5&page=2&locationCode=BACUS&deviceCategoryCode=JB&token=YOUR_TOKEN_HERE" }, "page":2, "returnOptions":"", "rowLimit":5 } } |
{ "files":[ { "archivedDate":"2010-06-03T08:27:23.000Z", "compression":"gz", "dataProductCode":"LF", "dateFrom":"2009-09-08T00:00:00.000Z", "dateTo":"2009-09-09T00:00:00.000Z", "deviceCode":"BC_POD2_JB", "fileSize":24668, "filename":"BC_POD2_JB_20090908T000000.000Z.txt", "modifyDate":"2015-01-09T19:40:22.000Z", "uncompressedFileSize":684891 } ], "serviceMetadata":{ "dateArchivedFrom":null, "dateArchivedTo":null, "dateFrom":null, "dateTo":null, "deviceCategoryCode":"JB", "locationCode":"BACUS", "next":{ "parameters":{ "method":"getListByLocation", "returnOptions":"all", "rowLimit":"1", "page":"2", "locationCode":"BACUS", "deviceCategoryCode":"JB", "token":"YOUR_TOKEN_HERE" }, "url":"https://data.oceannetworks.ca/api/archivefiles?method=getListByLocation&returnOptions=all&rowLimit=1&page=2&locationCode=BACUS&deviceCategoryCode=JB&token=YOUR_TOKEN_HERE" }, "page":2, "returnOptions":"all", "rowLimit":1 } } |
{ "files":[ { "archiveLocation":"/archive/AD/venus/VENUS_UNIQUE/VUNIQUE0007", "dateFrom":"2009-09-08T00:00:00.000Z", "filename":"BC_POD2_JB_20090908T000000.000Z.txt", "path":"00/15/88" } ], "serviceMetadata":{ "dateArchivedFrom":null, "dateArchivedTo":null, "dateFrom":null, "dateTo":null, "deviceCategoryCode":"JB", "locationCode":"BACUS", "next":{ "parameters":{ "method":"getListByLocation", "returnOptions":"archiveLocation", "rowLimit":"1", "page":"2", "locationCode":"BACUS", "deviceCategoryCode":"JB", "token":"YOUR_TOKEN_HERE" }, "url":"https://data.oceannetworks.ca/api/archivefiles?method=getListByLocation&returnOptions=archiveLocation&rowLimit=1&page=2&locationCode=BACUS&deviceCategoryCode=JB&token=YOUR_TOKEN_HERE" }, "page":2, "returnOptions":"archiveLocation", "rowLimit":1 } } |
Get a list of files available in Oceans 3.0 Archiving System for a given device code. The list of filenames can be filtered by time range.
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | string | All Web Services require a token. This can be generated at http://data.oceannetworks.ca/Profile. Click on the "Web Services" tab and click "Generate Token". | token=YOUR_TOKEN_HERE |
deviceCode | string | Return a list of files of a specific Device Code.
| deviceCode=BC_POD2_JB |
Optional | |||
dateFrom | date | Return files that have a timestamp on or after a specific date/time. Accepted DateTime formats:
If not specified, the default value is the beginning of time.
| dateFrom=2010-07-27T00:00:00.000Z dateFrom=2010-07-27 dateFrom=-P1DT1H
|
dateTo | date | Return files that have a timestamp before a specific date/time. Accepted DateTime formats:
If not specified, the default value is the end of time.
| dateTo=2016-08-01T00:00:00.000Z dateTo=2016-08-01 dateTo=PT12H30M
|
dateArchivedFrom | date | Return files archived on or after a specific date/time. Accepted DateTime formats:
If not specified, the default value is the beginning of time.
| dateArchivedFrom=2010-07-27T00:00:00.000Z dateArchivedFrom=2010-07-27 dateArchivedFrom=-P1DT1H
|
dateArchivedTo | date | Return files archived before a specific date/time. Accepted DateTime formats:
If not specified, the default value is the end of time.
| dateArchivedTo=2016-08-01T00:00:00.000Z dateArchivedTo=2016-08-01 dateArchivedTo=PT12H30M
|
fileExtension | String | Return files of a specific File Extension.
| png |
dataProductCode | String | Return files of a specific Data Product Code.
| HSD |
returnOptions | string | If there is no value given, 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" , more metadata information will be returned. *All results returned with serviceMetadata object. | returnOptions=archiveLocation |
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 |
page | integer | The service will return data starting from a certain page. By default this value is 1. If the data size is greater than rowLimit, results will be split into pages where each page contains at most rowLimit number of data. This parameter is used to generate serviceMetadata.next parameter, which can be used to get the next set of data. | page=1 |
getLatest | boolean | Specifies whether or not the latest raw data readings should be returned first. This is false by default. When set to true, readings are returned and pagination is done from latest to earliest. | getLatest=true |
HTTP status code 200 will be returned in HTTP header.
If "returnOption" parameter is "all", a list of file names with their metadata information will be returned.
{ "files": [ { "archivedDate": <date>, "compression": <string>, "dataProductCode": <string>, "dateFrom": <date>, "dateTo": <date>, "fileSize": <long>, "filename": <string>, "modifyDate": <date>, "uncompressedFileSize": <long> }, ], "serviceMetadata": { "dateArchivedFrom":<date>, "dateArchivedTo":<date>, "dateFrom":<date>, "dateTo":<date>, "deviceCode":<string>, "returnOptions":<string>, "rowLimit":<integer>, "page":<integer> } } |
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.dataProductCode | string | Data product code | 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.filename | string | The name of the file | "BC_POD2_JB_20090908T000000.000Z.txt" |
files.uncompressedSize | long | Original file size, in bytes, without compression | 155545654 |
serviceMetadata.dateArchivedFrom | date | As passed into the original call | |
serviceMetadata.dateArchivedTo | date | As passed into the original call | |
serviceMetadata.dateFrom | date | As passed into the original call | |
serviceMetadata.dateTo | date | As passed into the original call | |
serviceMetadata.deviceCode | string | As passed into the original call | "BC_POD2_JB" |
serviceMetadata.next | Object | An object containing information for the next service call if the current call was unable to return all the data due to limit restrictions. This is null if there is no more data in the requested range. | |
| Object | An object containing the set of parameters making up the query to get the next set of data in the requested date range. The parameters will include all parameters passed into the original URL. | |
| String | As passed into the original call | "BC_POD2_JB" |
| String | As passed into the original call | "getListByDevice" |
| integer | The page index for next call | 1 |
| String | As passed into the original call | "archiveLocation" |
| integer | As passed into the original call | 5 |
| String | As passed into the original call | "YOUR_TOKEN_HERE" |
| String | The complete URL that can be used to get the next set of data in the requested range. | |
serviceMetadata.page | integer | The page index for next call. 1 means all results are returned and there is no more data | |
serviceMetadata.returnOptions | string | As passed into the original call | |
serviceMetadata.rowLimit | integer | As passed into the original call | 5 |
{ "files":[ "BC_POD2_JB_20080929T000000.000Z.log", "BC_POD2_JB_20081002T000000.000Z.log", "BC_POD2_JB_20081002T000000.000Z.txt", "BC_POD2_JB_20081003T000000.000Z.txt", "BC_POD2_JB_20081004T000000.000Z.txt" ], "serviceMetadata":{ "dateArchivedFrom":null, "dateArchivedTo":null, "dateFrom":null, "dateTo":null, "deviceCode":"BC_POD2_JB", "next":{ "parameters":{ "method":"getListByDevice", "deviceCode":"BC_POD2_JB", "rowLimit":"5", "page":"2", "token":"YOUR_TOKEN_HERE" }, "url":"https://data.oceannetworks.ca/api/archivefiles?method=getListByDevice&deviceCode=BC_POD2_JB&rowLimit=5&page=2&token=YOUR_TOKEN_HERE" }, "page":2, "returnOptions":"", "rowLimit":5 } } |
{ "files":[ { "archivedDate":"2013-09-20T22:52:49.000Z", "compression":"gz", "dataProductCode":null, "dateFrom":"2008-09-29T00:00:00.000Z", "dateTo":"2008-09-30T00:00:00.000Z", "deviceCode":"BC_POD2_JB", "fileSize":87, "filename":"BC_POD2_JB_20080929T000000.000Z.log", "modifyDate":"2013-09-20T22:52:49.000Z", "uncompressedFileSize":67 } ], "serviceMetadata":{ "dateArchivedFrom":null, "dateArchivedTo":null, "dateFrom":null, "dateTo":null, "deviceCode":"BC_POD2_JB", "next":{ "parameters":{ "method":"getListByDevice", "returnOptions":"all", "deviceCode":"BC_POD2_JB", "rowLimit":"1", "page":"2", "token":"YOUR_TOKEN_HERE" }, "url":"https://data.oceannetworks.ca/api/archivefiles?method=getListByDevice&returnOptions=all&deviceCode=BC_POD2_JB&rowLimit=1&page=2&token=YOUR_TOKEN_HERE" }, "page":2, "returnOptions":"all", "rowLimit":1 } } |
{ "next": { "parameters": { "method": "getListByDevice", "fileExtension": "png", "deviceCode": "IOS3HYDARR01", "rowLimit": "5", "page": "2", "token": "TOKEN_HERE" }, "url": "https://data.oceannetworks.ca/api/archivefiles?method=getListByDevice&fileExtension=png&deviceCode=IOS3HYDARR01&rowLimit=5&page=2&token=TOKEN_HERE" }, "queryUrl": "https://data.oceannetworks.ca/api/archivefiles?method=getListByDevice&token=TOKEN_HERE&deviceCode=IOS3HYDARR01&rowLimit=5&fileExtension=png", "files": ["IOS3HYDARR01_20060314T130754.000Z-spect-H3.png", "IOS3HYDARR01_20060314T130754.000Z-spect-H2.png", "IOS3HYDARR01_20060314T130754.000Z-spect-H1.png", "IOS3HYDARR01_20060314T131752.000Z-spect-H3.png", "IOS3HYDARR01_20060314T131752.000Z-spect-H2.png"] } |
{ "next": { "parameters": { "method": "getListByDevice", "dataProductCode": "HSD", "deviceCode": "IOS3HYDARR01", "rowLimit": "5", "page": "2", "token": "TOKEN_HERE" }, "url": "https://data.oceannetworks.ca/api/archivefiles?method=getListByDevice&dataProductCode=HSD&deviceCode=IOS3HYDARR01&rowLimit=5&page=2&token=TOKEN_HERE" }, "queryUrl": "https://data.oceannetworks.ca/api/archivefiles?method=getListByDevice&token=TOKEN_HERE&deviceCode=IOS3HYDARR01&rowLimit=5&dataProductCode=HSD", "files": ["IOS3HYDARR01_20060314T130754.000Z-spect-H3.png", "IOS3HYDARR01_20060314T130754.000Z-spect-H2.png", "IOS3HYDARR01_20060314T130754.000Z-spect-H1.png", "IOS3HYDARR01_20060314T130754.000Z-spect-H3.pdf", "IOS3HYDARR01_20060314T130754.000Z-spect-H2.pdf"] } |
Download a file from Oceans 3.0 Archiving System by specifying the file name. The file will be downloaded without any compression.
Many files in the archive are compressed for storage, uncompressing these files takes time on the server and increases data volume to transfer. We will address this performance issue in a future update.
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
filename | string | A valid name of a file in DMAS Archiving System. | NAXYS_02345_P008_20100107T185747.660Z.wav |
token | string | Credential token. |
HTTP status code 200 will be returned in HTTP header and the requested file will be downloaded.
Get a list of files available in Oceans 3.0 Archiving System for a given station. The list of filenames can be filtered by device category and time range.
Parameters
ResponseSuccessHTTP status code 200 will be returned in HTTP header. If "returnServiceMetadata" is NOT set to "true" and if "returnOption" parameter is "all", a list of file names with their metadata information will be returned.
If "returnServiceMetadata" 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.
If "returnServiceMetadata" is set to "true" and if "returnOption" parameter is "all", a list of file names with their metadata information will be returned.
If "returnServiceMetadata" is set to "true" and if "returnOptions" parameter is NOT set, only a list of file names will be returned in JSON array object.
|