Create New Watchlist
Create a new watchlist for a particular user
Overview
This POST endpoint enables you to create a new watchlist for a user whose internal ID is provided in the request's path. The newly created watchlist can initially have either no securities or it could have a list of initial securities provided as an array.
There are six required parameters that must be provided in the request:
Authorization (header). This is the authorization token from the very first token request. The value of this header must have the following format:
Bearer BQ898r9fefi
(Bearer
+ 1 space + the token).API version (path). Unless necessary, leave it at "1.0".
userID (path). This is the ID of the user for whom a new watchlist will be created.
resultIncludeSecurities (query). This field indicates if the retrieved watchlist should include its corresponding stocks.
watchlist (body). This is the new watchlist.
New Watchlist Template
All new watchlists must be of the application/json content type. The syntax for new watchlists is as follows:
Empty Watchlist Sample
A Comprehensive Watchlist Sample
Internal ID of the required securities can be fetched using this API request.
Here's the final template for this API request:
Response
In response to this API request, you'll receive a JSON file with the information about the newly created watchlist. If the resultIncludeSecurities is set to true, the response will contain the securities in this watchlist.
where:
Id
This is the internal identifier of the watchlist in AutoShares.
Name
This is the name of the watchlist in AutoShares.
Type
This is the type of the watchlist. It could either be a user-created watchlist or a default watchlist provided by the system.
CreateDate
This is the date on which the watchlist was created.
ModifyDate
This is the date on which the watchlist was last modified.
ReadOnly
This field indicates if the watchlist is modifiable.
SecurityList
This is a collection of securities in the watchlist.
Common Mistakes
Here are some of the common mistakes that developers make when attempting to create a new watchlist.
Sending Improperly Constructed Watchlist
It's critical that you precisely follow the watchlist template at the beginning of this page and properly prepare the JSON with the new watchlist. Improperly specifying certain fields will lead to the 409 status code:
The following article covers the syntax for this API request in detail.
Last updated