Problem context
I'm updating my working Mathematica Khan Academy reporting application. Since updating to 11.2 I'm having some errors importing via the Khan Academy API as JSON. Update: This particular issue is broken in 11.0.1 and 11.2
Specifically, when making the same query with different "ListId" values, each representing a class of students I'm "coaching" in Khan Academy, one class works and the other returns an error: "Cannot import Data as JSON format"
What I've tried
link = "https://www.khanacademy.org/api/internal/user/students/\
progress?dt_start=2017-10-22T07:00:00.000Z&dt_end=2017-10-29T06:59:59.\
999Z&listId=\
ag5zfmtoYW4tYWNhZGVteXJsCxIIVXNlckRhdGEiRnVzZXJfaWRfa2V5X2h0dHA6Ly9pZC\
5raGFuYWNhZGVteS5vcmcvYThlN2M3MWFiYjliNGJhZjg3OWM5ZTIxODQwMWQ5NWIMCxIL\
U3R1ZGVudExpc3QYgICAgKCOgQoM&studentsPerRequest=50&extended=1&tz_\
offset=-420&lang=en";
URLRead[HTTPRequest[
OAuthSigning`Private`HMACSha1SignatureService[link, "HMAC",
"GET", $consumerKey, $consumerSecret, $accessTokenParams[
"oauth_token"], $accessTokenParams["oauth_token_secret"]]]]
Returns:
Import[HTTPRequest[
OAuthSigning`Private`HMACSha1SignatureService[link, "HMAC",
"GET", $consumerKey, $consumerSecret, $accessTokenParams[
"oauth_token"], $accessTokenParams["oauth_token_secret"]]
]]
Returns:
URLExecute[HTTPRequest[
OAuthSigning`Private`HMACSha1SignatureService[link, "HMAC",
"GET", $consumerKey, $consumerSecret, $accessTokenParams[
"oauth_token"], $accessTokenParams["oauth_token_secret"]]
]]
Returns:
And when I click on the link, in the web it says, "OAuth error. Nonce already used: 15Y3zVd9cGGR6jQjGcogv043"
But!
When I try this with another link, which only contains a different ListId (representing a different class of students I'm managing), everything works as expected. I am able to use other API endpoints with this class, without error so I know that the ListId is valid. Also, its strange but true, Khan Academy encourages the use of undocumented, private API endpoints.
Import[#, "JSON", "StrictDecoding" -> False]
. $\endgroup$nonce already used
error? $\endgroup$OAuthSigning`...
call and simply going there. Also what do the guts of theHTTPResponse
look like? (qualitatively, i.e. is there data cached in it that you can work look at to see what's gone wrong) $\endgroup$cannot import data as JSON format
error $\endgroup$"Text"
to see what could be messing up the JSON import $\endgroup$