saxobank / openapi-samples-js Goto Github PK
View Code? Open in Web Editor NEWSample code demonstrating OpenAPI interactions in JavaScript
Home Page: https://www.developer.saxo/openapi/learn
License: Apache License 2.0
Sample code demonstrating OpenAPI interactions in JavaScript
Home Page: https://www.developer.saxo/openapi/learn
License: Apache License 2.0
Describe the bug
I understand that "Trade On Quote" feature has been disabled recently.
rQ = tr.positions.PositionByQuote(data=dataOrdQuote)
Can you please suggest what is alternate for this functionality.
I tried to see feasibility of "Multi Leg Order", but it seems like it does not support "Currency Option Trades" (it needs uic)
Please suggest alternate.
Additional context
Add any other context about the problem here.
I followed your instructions. https://github.com/SaxoBank/openapi-samples-js/tree/master/authentication/oauth2-certificate-flow/example_nodejs
I got "Bad Request". and I try to change Cert and config more, but I still got "Bad Request"
Do do have any idea for help me?
Describe the bug
OpenAPI 'Instruments Lookup' Failing with 404 in Live Environment (works perfectly in Simulation environment)
To Reproduce
I get a result:
{
"Data": [
{
"AssetType": "Stock",
"CurrencyCode": "AUD",
"Description": "Piedmont Lithium Ltd",
"ExchangeId": "ASX",
"GroupId": 12489,
"Identifier": 7671883,
"IssuerCountry": "US",
"SummaryType": "Instrument",
"Symbol": "PLL:xasx",
"TradableAs": [
"Stock"
]
}
]
}
X-Correlation: 44df3b1e3519427895b4a4c02aaa5d50#2958#82ee4235-f409-49f3-af65-3d10abee9fc1#82
I get an HTTP 404/Not Found
Response
X-Correlation: 7b6ffad83f8a4962a7e74477f5dea850#824#addb4598-31af-4455-83c6-6808d2e1b532#352
Please note: I have the correct and valid access tokens used in both. I know they are correct and valid because if I use the wrong ones, or they're expired, I get an expected 401/Unauthorized.
Expected behavior
I expected the LIVE account instrument lookup URL to work as described in your documentation. It doesn't.
Screenshots
Simulator: working:
Live: Has the LIVE api endpoint and the LIVE account key and access token, but otherwise identical to the sim one:
As you can see, the only difference between those urls is the /sim/
slug and the client account keys
Desktop (please complete the following information):
Additional context
I've tried various combinations of adding/removing /
at the end, casing of query-string parameters, ordering of query-string parameters. Whatever I do works perfectly in the simulation environment, but the live one fails with a 404 Every. Single. Time.
Please can you update the documentation to reflect the actual URL/endpoint we should be using for the LIVE instrument lookup? Or if it's not available any more, can you indicate it's obsolete/deprecated (and perhaps suggest how else we might go about doing an instrument lookup). Is there a versioning difference? Or, alternatively, fix the LIVE endpoint so it doesn't 404?
Thanks :)
The first authorization step is correct but when you try to execute the second step (redirect) to obtain the token, it gives an error "failed to open stream: Invalid arguement" "X-Correlation header (for troubleshooting with Saxo): Null.
In the server-config file I have changed the Key and the secret
I'm trying to run JS Code Flow Sample with SIM environment. On the Step 2 when I click on 'Get token with NodeJS' I get:
Error with status 401 Unauthorized
Unauthorized: Unauthorized
X-Correlation header (for troubleshooting with Saxo): null
Any idea how to fix this?
Hello,
Thx vm for thoses samples. very useful.
In OAuth2 Code Flow example
After redirect, get_code works fine but get_token fails with the following error:
localhost/:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
Any idea why?
PS: I've used the live gateway in this test with correct Appkeys and links
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.