Rest API access code not found

I am unable to connect through an web path post like this:

<form action="https://api.particle.io/v1/devices/[device name]/led?-d access_token=[access code]" method="POST">

However, using the same access code with curl works? Any ideas?

Kurt

Hi @kjwilde

I edited your post to make the HTTP command readable. Click the little pencil to see the markup syntax I added.

The -d syntax is unique to Curl and not used elsewhere. You could use & to append the parameters to the URL but I would really recommend you take a look at this tutorial I wrote that uses a different and more flexible style:

2 Likes

Maybe I"m missing something here. I’ve tried both forms:

<form action="https://api.particle.io/v1/devices/[device name]/led?-d access_token=<access code>" method="POST"

and

<form action="https://api.particle.io/v1/devices/<device name>/led?<access code>" method="POST">

They both result in:

{
  "error": "invalid_request",
  "error_description": "The access token was not found"
}

Ah-ha! It simply needs removing the -d and leaving the access_code= bit in. I must have misunderstood. Thanks.