Suddenly have an issue with Jquery POST

I’ve had a web app coded for weeks that connects to a spark core and retrieves data using a POST request.
Suddenly tonight I’m getting an error. I can’t understand what could have changed. I’ve tried reflashing the device and it reprograms and connects to wifi fine.

post code:
var dumpIn = “grabit”; //this is the name of the spark core function that initiates data transfer
var dumpInn = “grabData”; //this is the parameter of the spark core function that initiates data transfer
var deviceID = selectedCore;
var accessToken = securityKey;
var requestURL = “https://api.spark.io/v1/devices/” + deviceID + “/” + dumpIn + “/”;
$.post( requestURL, { params: dumpInn,access_token: accessToken }); // this is the post method that formats the url correctly to trip the spark core function
console.log(requestURL);

I get the following error:

I can’t imagine what the issue is. Any help appreciated.

I’m not sure if it might be an expired access token? :smiley:

1 Like

@kennethlimcp ennethlimcp - Oh, they expire?

The access code still matches what shows up in my userprofile on spark.io

What is odd is according to spark’s documentation:

400 Bad Request - Your request is not understood by the Core,
or the requested subresource (variable/function) has not been exposed.

401 Unauthorized - Your access token is not valid.

This worked just last night, and earlier today.

Currently, it’s 4 months. User control is in the backlog but i’m not sure when. :smiley:

2 Likes

@kennethlimcp - You are right. It is expired. You just made me tear up a little bit cause I was so mad at myself for somehow screwing it up :smile:

Thanks!