Skip to content

Instantly share code, notes, and snippets.

@BryantAvey
Last active April 24, 2022 20:25
Show Gist options
  • Save BryantAvey/91e4d9faea0d2f6a20feaf5fef080f16 to your computer and use it in GitHub Desktop.
Save BryantAvey/91e4d9faea0d2f6a20feaf5fef080f16 to your computer and use it in GitHub Desktop.
TD Ameritrade API with Neo4j: Generate a new refresh token using token code
// Generate New Refresh Token
CALL apoc.load.jsonParams("https://api.tdameritrade.com/v1/oauth2/token",null,"grant_type=authorization_code&refresh_token=&access_type=offline&code=" + "Paste_Your_CODE_Here" + "&client_id=YOUR_CONSUMER_KEY_GOES_HERE %40AMER.OAUTHAP&redirect_uri=YOUR_CALLBACK_URL_GOES_HERE")
YIELD value
UNWIND value.refresh_token as refresh_token_90days
//UNWIND value.access_token as access_token_30m
RETURN refresh_token_90days //, access_token_30m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment