Watch Lists


GET watchlists

Description

Get all watch lists created by the requester.

Resource URL

https://api.optionscity.com/watchlists
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Watch List
Response Type Standard

Example Request

GET https://api.optionscity.com/watchlists

Example Response

[ {
  "id" : "abc",
  "name" : "My Watch List",
  "instrument_ids" : [ 123, 456 ]
} ]

GET watchlists/:id

Description

Get a single watch list by ID.

Resource URL

https://api.optionscity.com/watchlists
Authentication Required
HTTP Methods GET
Media Types application/json
Response Object Watch List
Response Type Standard

Parameters

NameDescriptionRequired?Type
id City API watch list ID. Yes String

Example Request

GET https://api.optionscity.com/watchlists/abc

Example Response

{
  "id" : "abc",
  "name" : "My Watch List",
  "instrument_ids" : [ 123, 456 ]
}

POST watchlists

Description

Create a new watch list.

Resource URL

https://api.optionscity.com/watchlists
Authentication Required
HTTP Methods POST
Media Types application/json
Response Object Watch List
Response Type Standard
Request Object Watch List

Example Request

POST https://api.optionscity.com/watchlists
{
  "name" : "My Watch List",
  "instrument_ids" : [ 123, 456 ]
}

Example Response

{
  "id" : "abc",
  "name" : "My Watch List",
  "instrument_ids" : [ 123, 456 ]
}

PUT watchlists/:id

Description

Update the specified watch list with a new definition.

Resource URL

https://api.optionscity.com/watchlists
Authentication Required
HTTP Methods PUT
Media Types application/json
Response Object Watch List
Response Type Standard
Request Object Watch List

Parameters

NameDescriptionRequired?Type
id City API watch list ID. Yes String

Example Request

PUT https://api.optionscity.com/watchlists/abc
{
  "name" : "My Watch List",
  "instrument_ids" : [ 123, 456 ]
}

Example Response

{
  "id" : "abc",
  "name" : "My Watch List",
  "instrument_ids" : [ 123, 456 ]
}

DELETE watchlists/:id

Description

Delete the specified watch list.

Resource URL

https://api.optionscity.com/watchlists
Authentication Required
HTTP Methods DELETE
Media Types application/json
Response Object None
Response Type Standard

Parameters

NameDescriptionRequired?Type
id City API watch list ID. Yes String

Example Request

DELETE https://api.optionscity.com/watchlists/abc

Watch List Object

Description

A user-defined list of instruments. These lists can be used to organize instruments relevant to the user.

Fields

Field Type Optional Description
id String No City API assigned identifier.
name String Yes Name given to the list.
instrument_ids NumberArray No Instruments in the list, identified by City API instrument IDs.

JSON Sample

{
  "id" : "abc",
  "name" : "My Watch List",
  "instrument_ids" : [ 123, 456 ]
}

* Date and time elements are ISO-8601 string representations