- ago
This morning I ran Historical providers update and Meta Strategy which is made up of 11 strategies. I do use TD for the NASDAQ composite data because its much more accurate than Yahoo or other sources. I don't know if its something I am doing or something in the API interface but I did receive the following email from TD today.

My name is Mike from the TD Ameritrade API team. We actively monitor our different API endpoints to ensure we can continue to provide a stable environment for our applications. We see that you have requested over 1200 tokens this morning before the open. Generally speaking for authentication, an access token should be generated once every 30 min using an existing valid refresh tokens in the request. There are two types of tokens: a refresh token and an access token. A refresh token is valid for 90 days. They are used to create new refresh and access tokens in the future. Access tokens are valid for 30 minutes. These access tokens are used to authenticate into the different APIs. As long as you have a valid refresh token, use the following parameters with the Post Access Token API to create only an access token:



grant_type: refresh_token

refresh_token: <insert valid refresh token>

client_id: <insert consumer key>



As your refresh token is about to expire (e.g. the 89th day), use the following parameters to create a new refresh token:



grant_type: refresh_token

refresh_token: <insert valid refresh token>

access_type: offline

client_id: <insert consumer key>



The above requests can be done without ever interacting with the login screen after the initial sign-on screen and should not be excessively done on a short time period. Please take a look at your application to correct this issue, and let us know if you have any further questions.



Kind regards,
0
1,123
Solved
10 Replies

Reply

Bookmark

Sort
Cone8
 ( 4.92% )
- ago
#1
Thanks for the message. We'll look into it.

Since they said 1200 tokens before the open, presumably this could have occurred during a data update of the Nasdaq Comp? Daily data?
0
Cone8
 ( 4.92% )
- ago
#2
We're doing it all correctly as outlined above, but I think the issue today was that you must have run the update precisely at the time the access token required a refresh, so it got hit once for each historical request. We can fix that - next build.
0
- ago
#3
The problem seems to be back. This is the message I received today from TDAmeritrade
"We are seeing an excessive number of tokens generated from your application again. Please troubleshoot and correct the code as soon as possible. If the excessive token generation is not corrected, your application will be throttled for all non-order related requests. Please reply directly to this email if you have any questions.

Kind regards,
William Edwards
Sr Specialist, Digital Product Management
TD Ameritrade
600 West Chicago Avenue, Suite 800
1-800-672-2098
william.edwards@tdameritrade.com"
0
Cone8
 ( 4.92% )
- ago
#4
Can you give us something to work with?
Are there any Log Viewer messages?
When was the last time you had to log in?
How many days are remaining before Refresh Token expires?
0
- ago
#5
I ran to update TD data set around 3am Eastern US time. There were 36 days left to refresh. Last time I logged in was about 50 days ago. I have no Log View messages if there were any I did not check the results of the update other than it was complete.
0
Cone8
 ( 4.92% )
- ago
#6
It occurred during an update of the Nasdaq composite?
Something like 3000 symbols?
Daily? Intraday?

Turns out I've got 35 days left on my current token, so our initial conditions are pretty close to the same.

Please ask William Edwards which type of tokens were being created - were they access or refresh tokens? I presume they were access tokens since you still had a month left before a refresh was needed. Still, it would help to know for sure that we were trying to create too many access tokens.
0
Glitch8
 ( 11.27% )
- ago
#7
The next time you go 50 days before logging in, try refreshing the token manually as a first step until we get a handle on any possible required changes at our end.
0
Cone8
 ( 4.92% )
- ago
#8
I waited until my access token was 27 minutes old, then I launched an update of the Russell 1000. No problems on my end, but let's see if William E. has something to say about it.
0
Glitch8
 ( 11.27% )
- ago
#9
It's worth noting to also make sure the TD Extension is up to date!
0
Cone8
 ( 4.92% )
- ago
#10
Try using Build 8. We took a shot in the dark to make sure the refresh method isn't re-entered without having checked for a refresh token first.
0
Best Answer

Reply

Bookmark

Sort