How do I find my access token?

Absolutely… the more you share, the better we can help :smile:

Before debugging your HTML though, did you make sure whatever you are doing works using the command line tool?

I don’t know how to do that.

I’m just trying to follow this:

If I get a new token, shouldn’t it show up in my “settings”?

No. There are several types of tokens. As far as I know the one in your Settings will be listed under user when doing a particle token list. All the other ones are generated for use with the API.

I’m afraid I’m not setup to test the tutorial. I’d definitely make sure you can move that servo using the Particle command line tool before worrying about the HTML part of it.

Hi @dcdenison

Here is a screenshot to show you the simplest way to get your token, which is a hex number, from the web IDE or Build. First you click on the little gear icon on the bottom left and this panel comes up. You then can copy the access token to use in other programs. Here I have painted over my actual token with “1234abcf…”

1 Like

hey thanks for contributing. I’m actually trying to do your tutorial. You’re famous!

I’ve been using that Access Token, but no luck.

And it doesn’t match with the token I get from the command line.

Reset Token seems to just generate new numbers that don’t have any relation to my actual token.

where would I find instructions for doing it in the command line?

You can and probably do have many access tokens, not just one. If the one from the Build web IDE is not working, then it is likely that something else is wrong. A way that lots of people have had problems is by accidentally having two Particle accounts with two different emails or a typo in their email when they set it up. You can end up with you logging into to one Particle account but your devices belong to a different account.

Can you flash code from the Build web IDE over the air? If so, the web IDE token should work.

The Particle CLI is a great way to interact with your devices and manages tokens behind the scenes but you have to login with your Particle account email/password. Again if you have problems with accounts that could cause what you are seeing.

Finally the underlying web-based interface to Particle is doc’ed here:

Using a program like curl you can manage tokens completely if you are an expert.

1 Like

To make sure your device works in the first place, and you can call the functions you’re trying to reach, you can give this page a try: That’ll show you your devices, and allows you to call/request functions and variables. If that doesn’t work, then it’s probably something other than the accesstoken.

1 Like

Hi, that just hangs for me.

let me know if I’m doing anything wrong.


I would definitely say that you are actually more famous. I recognized your byline and photo right away since I live in the Boston area.

Funny. I actually just interviewed Zach Supalla for an upcoming issue of Make:

You should stop by Cambridge Hackspace if you’re in the area. Tuesday nights are the weekly open house.


So I generated a new token using the command line, but it has no relation to the access token in my Build IDE. Shouldn’t they synch up? After a refresh, or a cache clear?

The one in the Build IDE is a separate one, which should also have an unlimited lifetime. The ones you generate in the CLI are entirely new ones. They don’t sync up since they’re different accesstokens altogether, both having access to your account.
Could you try logging out of all things Particle, and logging in again? Make sure you can see your devices in the devices tab of the IDE, and then use the accesstoken that’s in the settings tab. That should work.
The page I linked you to, does that generate an error message of some kind?

okay, thanks. I’ll give it a try.

Hi @dcdenison

No, you can have many, many tokens with differing lifetimes. The one in the web IDE is a long-life token, but when you construct them yourself, you can control their lifetimes.

If you have curl, the command line tool, you can list them like this:

curl -u yourUsername:yourPassword

Obviously replacing yourUsername and yourPassword with correct values. When I do this I have 33 tokens, many of which have expired.

How’s my html look? Maybe this is the problem?

<script src="" type="text/javascript" charset="utf-8"></script>
<p>Set Servo Position:<br />
<br />
<input id="degBoxId" list="myData" max="180" min="0" name="degBox" onchange="setValue(this)" step="1" type="range" value="90" /> <!-- This adds the tick marks to the range but does not in Safari --> <datalist id="myData"><option value="0"></option><option value="30"></option><option value="60"></option><option value="90"></option><option value="120"></option><option value="150"></option><option value="180"></option></datalist><br />
<br />
<button id="minusbutton" onclick="fineAdjust(-5)">⇐ -5 °</button><button id="plusbutton" onclick="fineAdjust(+5)">+5 ° ⇒</button><br />

<p>Current Position:<br />
<script type="text/javascript">
      var deviceID = "xxx";
      var accessToken = "xxx";
      var setFunc = "setpos";
      var getFunc = "getpos";

      window.setInterval(function() {
        requestURL = "" + deviceID + "/" + getFunc + "/?access_token=" + accessToken;
        $.getJSON(requestURL, function(json) {
                 document.getElementById("curPos").innerHTML = json.result + "&deg;";
                 document.getElementById("curPos").style.fontSize = "28px";
                 document.getElementById("degBoxId").value = parseInt(json.result);
      }, 1000);

      function setValue(obj) {
        var newValue = document.getElementById('degBoxId').value;
      function fineAdjust(value) {
        var currentValue = parseInt(document.getElementById('curPos').innerHTML);
        var setValue = value + currentValue;
        document.getElementById("degBoxId").value = setValue;

      function sparkSetPos(newValue) {
	var requestURL = "" +deviceID + "/" + setFunc + "/";
        $.post( requestURL, { params: newValue, access_token: accessToken });


If you took that from the tutorial, there shouldn’t be anything wrong. At a quick glance, it looks okay to me. That said, providing you’ve inserted the correct credentials, you should really be able to log into the paged I linked to, showing you your devices/functions/variables.

Hi @dcdenison

Are you using Chrome or Firefox or Safari? Internet Explorer is not a modern enough browser to handle a lot of this code and will only cause problems.

Somewhere along the line some non-ascii characters came into your HTML. Some editor or other thing interpreted the &deg; and &lArr; &rArr; characters codes and substituted the rendered versions instead so the button text is messed up. This is cosmetic and should not stop it from working.

1 Like