How do I find my access token?

Hi, working with an electron in the Particle IDE.

Trying to control a servo.

How do I get my access code?

I was pulling it from the “Settings” in the IDE, but that doesn’t seem to work. Also “Reset Token” doesn’t seem to generate a usuable one.

Tried command line, and got a confusing list of tokens. Not sure which one is the one I should use.

Some say “PASSWORD_ONLY,” others say “particle ios” (probably tinker?)

So how do I get to my actual, usable, access token?

Thanks,

DC

I’ve never had a problem using the one they provide in the IDE. You can list the tokens via the API, as as long as it’s not expired they should all work.

How are you using the token and what error message do you get?

thanks yan.

I’m just not connecting to the device. So I’m assuming that the access token is the problem.

I’ve tried everything else : )

Run us through what you’ve tried and how you are trying to connect to it. I’m happy to help if I can :smile:

I tried the command line: particle token list.

got a bunch that say “PASSWORD_ONLY”

Also, isn’t there a way to just go to “my account” and get my token?

the token that appears in the “Settings” in the IDE is not my token, right?

It is. Try doing a particle token new and use that new token and see what happens.

okay, I’ll try that when i get to work (and better internet connectivity). Should just be an hour or so. thanks.

Darn. Tried it with the new token. Didn’t work.

Can I share my html? Two experts from my hackspace looked at it last night, and are stumped as well.

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:

https://docs.particle.io/reference/api/#generate-an-access-token

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: http://jordymoors.nl/interface 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.

DC