new Xignite( [token] [, params])
Xignite version of quotes which uses web API to fetch data. Pass the Xignite provided token to the constructor ( intended for internal testing only). If constructed without a token then the STX.QuoteFeed.Xignite.Utility.overrides members will be examined for rules on building the url path and token.
Note: please review the following tutorial about data accessibility before attempting to request data from the browser : Integrating Third Party Data Feeds
If you need to have a different protocol than the default ("https://") add the following line, changing the protocol as needed.
STX.QuoteFeed.Xignite.Utility.overrides.protocol="https://";
If you need to have a different path than the defaults (see proxy config sample) add the following line. The same path will be appended to all calls.
STX.QuoteFeed.Xignite.Utility.overrides.path="your path here";
If you need to point to a specific server add the following line.
STX.QuoteFeed.Xignite.Utility.overrides.server = serverhere;
To set the encrypted token add the following line
STX.QuoteFeed.Xignite.Utility.overrides.token = encryptedTokenHere;
To set the userid add the following line
STX.QuoteFeed.Xignite.Utility.overrides.tokenUser= userIdHere;
Notes:
- The client is responsible for the formation and management of the encrypted token.
- The client should make sure they have a non-expired token before querying Xignite.
- The client should be writing their own encryption on the server side.
- The client may store their unencrypted token within this script or elsewhere on their server, but not on the files delivered by the web server.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
token |
string |
<optional> |
optional Xignite API token |
params |
object |
<optional> |
optional Xignite parameters |
Examples
Default use case stxx.attachQuoteFeed(new STX.QuoteFeed.Xignite(myToken));
Using an encrypted token STX.QuoteFeed.Xignite.Utility.overrides.protocol = null; STX.QuoteFeed.Xignite.Utility.overrides.server = null; STX.QuoteFeed.Xignite.Utility.overrides.path = ""; // note this is "" and not null STX.QuoteFeed.Xignite.Utility.overrides.token = 'encrypted token'; STX.QuoteFeed.Xignite.Utility.overrides.tokenUser= 'firm'; stxx.attachQuoteFeed(new STX.QuoteFeed.Xignite());
Using a proxy server STX.QuoteFeed.Xignite.Utility.overrides.server="yourProxyServer.yourCompany.com"; stxx.attachQuoteFeed(new STX.QuoteFeed.Xignite()); // Then, have your proxy inject the token, firm, etc. as required by Xignite and relay the request.