Step 0.: validate you access credentials:
Using a default OANDA curl
example, validate your access credentials:
curl \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTHENTICATION TOKEN>" \
"https://api-fxtrade.oanda.com/v3/accounts/<ACCOUNT>/pricing?instruments=EUR_USD%2CUSD_CAD"
CASE isERR: proceed to OANDA Support for fixing your issues with invalid credentials.
CASE wasOK: proceed to Step 1.
Step 1.: replicate the curl
call syntax AS-IS inside a one-shot python
nothing added, nothing excluded. Ought provide the same results as in Step 0.
CASE isERR: review your one-shot python-code, so as to meet 1:1 the working OANDA specification, already proved to be working in Step 0.
- Review OANDA Service Status, using
curl
below:
curl http://api-status.oanda.com/api/v1/services
- Review reported Error details.
CASE wasOK: proceed to Step 2.
Step 2.: extend the python code so as to request and process response
yet, keep in mind, not to go beyond OANDA stated maximum count of requests per day and similar restrictive limits, which ought be handled with care.
CASE isERR: Review OANDA Service Status, using curl
below and possible reported Error details:
curl http://api-status.oanda.com/api/v1/services
CASE wasOK: Congrats, your pricing-source got working end-to-end up to the specifications.
Error 405 is not a "not supported" service BUT "not allowed"
405 Method Not Allowed
A “405 Method Not Allowed” response may be returned from the v20 REST API when the client is attempting to access an API endpoint with an HTTP method that is not supported. The response Content-Type will be application/json and has the following schema:
{
#
# The code of the error that has occurred. This field may not be returned
# for some errors.
#
errorCode : (string),
#
# The human-readable description of the error that has occurred.
#
errorMessage : (string, required)
}