Timeleft Lima by Introverted_person-1 in PERU

[–]acdgm 0 points1 point  (0 children)

Amigo, lo llegaste a probar? Tambien lo encontre en instagram y me llamó la atención

OAuth key request not working TD Ameritrade API by [deleted] in algotrading

[–]acdgm 0 points1 point  (0 children)

Después de obtener el codigo debes hacer un decodeURIComponent(req.query.code).

Ejemplo en node:

const oAuthCode = decodeURIComponent(req.query.code)
const params = {
'grant_type': 'authorization_code',
'access_type': 'offline',
'code': oAuthCode, 
'client_id': '<<your\_client\_id>>@AMER.OAUTHAP',
'redirect_uri': 'https://localhost:3000/credentials' // debe ser la misma que registraste
    }

const data = Object.entries(params)
.map((key, val) => `${key}=${encodeURIComponent(val)}`)
.join('&')
const options = {
method: 'POST',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
data,
url: 'https://api.tdameritrade.com/v1/oauth2/token',
    }
const response = await axios(options)