Skip to content

Instantly share code, notes, and snippets.

@BryantAvey
Last active April 24, 2022 20:25
Show Gist options
  • Save BryantAvey/8bb2bc11cebb8ab08f5944d090c4c37a to your computer and use it in GitHub Desktop.
Save BryantAvey/8bb2bc11cebb8ab08f5944d090c4c37a to your computer and use it in GitHub Desktop.
TD Ameritrade API with Neo4j: Cypher to create a parameter for a reusable Access Token
// Parameterize the access bearer token
:param token => {CALL apoc.load.jsonParams("https://api.tdameritrade.com/v1/oauth2/token",null,"client_id=YOUR_CONSUMER_KEY_GOES_HERE%40AMER.OAUTHAP&grant_type=refresh_token&refresh_token=" + apoc.text.urlencode("YOUR_90_DAY_REFRESH_TOKEN_GOES_HERE_FROM_PREVIOUS_STEP"))
YIELD value
RETURN "Bearer " + value.access_token as access_token}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment