Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Wiki Markup
h2. *Description*

The station service allows users to retrieve station information across all of the networks.

h3. URL

| [

Description

The station service allows users to retrieve station information across all of the networks.

URL

http://dmas.uvic.ca/api/stations

...

Method

Description

Example

getTree

Get a hierarchical tree structure of stations, station codes, and their device categories.

method=getTree

getTree

Get a hierarchical tree structure of stations, station codes, and their device categories across all networks.

 Parameters

Parameter

Value

Description

Example

Required

There are no required parameters.

Optional

None

 

 

 

Response

Success

Code Block
languagejavascript
] |

|| Method || Description || Example ||
| [getTree|http://internal.neptunecanada.ca/#stations-getTree] | Get a hierarchical tree structure of stations, station codes, and their device categories. | method=getTree |

h2. getTree

Get a hierarchical tree structure of stations, station codes, and their device categories across all networks.

h3.  Parameters

|| Parameter || Value || Description || Example ||
| {color:#993300}{*}Required{*}{color} |
| There are no required parameters. |
| {color:#993300}{*}Optional{*}{color} |
| None\\ | | | |

h3. Response


h4. Success
{code:language=javascript}[
    {
        "deviceCategories": [],
        "els": [
            {
                "description": "<div>Way up North</div>", // description property removed when description value is null
                "deviceCategories": [],
                "els": [
                    {
                        "description": "<div>Instrumentation located at the end of a dock.</div>",
                        "deviceCategories": [
                            "CTD",
                            "ICEPROFILER",
                            "METSTN"
                        ],
                        "els": [],
                        "id": 88,
                        "name": "Dock",
                        "siteDeviceIds": [
                            119202,
                            119199,
                            119200
                        ],
                        "stationCode": "CBDCK",
                        "type": 10
                    }
                ],
                "id": 84,
                "name": "Cambridge Bay",
                "siteDeviceIds": [],
                "stationCode": "CB",
                "type": 10
            }
        ],
        "id": 82,
        "name": "Arctic Observatory by Location",
        "siteDeviceIds": [],
        "stationCode": "KRSTA",
        "type": 10
    }
]

...

Property

...

Type

...

Description

...

Example

...

description

...

string

...

A description of the station

...

Cambridge Bay, Victoria Island, NU

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="99ea1e5e-c04c-497e-bb64-0a2c657581a7"><ac:plain-text-body><![CDATA[

...

deviceCategories

...

array

...

An array of decive category code strings

{code}
|| Property || Type || Description || Example ||
| description | string | A description of the station | Cambridge Bay, Victoria Island, NU |
| deviceCategories | array | An array of decive category code strings | \["CTD","ICEPROFILER","METSTN"

...

]]></ac:plain-text-body></ac:structured-macro>

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bd7d0c27-43bb-4be4-903f-29da810c1df8"><ac:plain-text-body><![CDATA[

...

els

...

array

...

Array of child nodes

...

[JSONObject]

...

]]></ac:plain-text-body></ac:structured-macro>

...

id

...

integer

...

The resource ID of the node.

...

123456

...

name

...

string

...

The name of the station.

...

"Cambridge Bay"

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c29e028a-07ed-40ef-9c21-0e830d675d72"><ac:plain-text-body><![CDATA[

...

siteDeviceIds

...

array

...

An array of integers

\] |
| els | array | Array of child nodes | \[JSONObject\] |
| id | integer | The resource ID of the node. | 123456 |
| name | string | The name of the station. | "Cambridge Bay" |
| siteDeviceIds | array | An array of integers | \[119202,119199,119200

...

]]></ac:plain-text-body></ac:structured-macro>

...

stationCode

...

string

...

The unique code for the station

...

"CB"

...

type

...

integer

...

The resource type of the node. All nodes in this structure are of type 10.

...

10

Failure

See Extermal Web Services Standards

Example

Show all stations, with searchable devices

\] |
| stationCode | string | The unique code for the station | "CB" |
| type | integer | The resource type of the node. All nodes in this structure are of type 10. | 10 |
{color:#000000}{*}Failure{*}{color}

See&nbsp;[Extermal Web Services Standards|http://external+web+services+standards+error+messaging]

h3. Example

_Show all stations, with searchable devices_

[http://dmas.uvic.ca/api/stations?method=getTree&token=SAMPLETOKEN123456789|http://dmas.uvic.ca/api/stations?method=getList&token=SAMPLETOKEN123456789

...

]


[|http://dmas.uvic.ca/api/stations?method=getList&showHidden=true&token=SAMPLETOKEN123456789

...

]

[JavaScript Usage Example of Station Service|^stationTreeExample.html]