400 The access token was not found

My Spark Core works perfect till today. A month ago I had a problem with the Token. I didn’t know that it expired every 90 days or so. But I found out at this forum I need to create a new token. I did so, and that works fine. But today I got the error again. The 90 days are not over, and the Spark settings page also didn’t report that my token is expired. Anyhow, I reset the token again, but still no luck.

The output in the browser when requesting the URL including the new token is:
{
“code”: 400,
“error”: “invalid_request”,
“error_description”: “The access token was not found”
}

Anybody a clue why it isn’t working anymore?

Hi @jurjendevries,

There’s currently some intermittent behavior if the core resets after a firmware upgrade etc… (see the pinned thread)

Did you did a firmware update or reset the core?

It should work after a few tries for now…

Thanks for you quick reply @kennethlimcp . My Spark isn’t near me, so I am not able to reset the core. I didn’t do firmware updates by myself, but the Spark site reports “You are building with SPARK FIRMWARE V0.3.3 (SEP 9)”. I didn’t update this in september, so I guess the spark updates firmware by itself.

Is your suggestion to reset the Spark when I am near to it?

Best,
Jurjen

So basically, you did not make any changes to the code?

What url are you hitting on?

The statement simply means that you are building with the version of firmware specified. The core will not automatically update firmware if you did not do so.

No, I didn’t make any changes since 1 month. My Spark works fine till today.
The only thing I did change 1 month ago was the token, because I had to due the expire date.

The URL I am hitting is https://api.spark.io/v1/devices/55ff72065075555323371887/digitalwrite/access_token=MYTOKEN&params=D1,HIGH
Of course MYTOKEN is normally the access token given to me at the Spark.io settings page.

You need a ? instead of a / before the access_token

Try this:

https://api.spark.io/v1/devices/55ff72065075555323371887/digitalwrite?access_token=MYTOKEN&params=D1,HIGH 

OKe, thanks. Strange it worked before.

When I try your suggetion I got:
{
“error”: “Timed out.”
}

@kennethlimcp it’s working again. I was able to go to the Spark, it was flashing the light that it didn’t got a connection to the Spark cloud.
I disconnected the power for a few seconds, and it worked. It’s kind of strange problem, I hope it won’t happen again.

1 Like