

You must give a valid OAuth client ID and secret in HTTP Basic Auth or in the client_id and client_secret parameters.

curl -d access_token=38bb7b318cc6898c80317decb34525844bc9db55 \Ĭreates an access token that gives you access to the Cloud API. If you need a different request type, you have to specifically say so with the -X flag,įor example -X PUT. Using curl, each parameter you send, including the access token is preceded by a -d flag.īy default, if you add a -d flag, curl assumes that the request is a POST. The request body is how form contents are submitted on the web. To send the access token in the query string just add access_token=38bb.īecause your terminal may think the question mark is special, enclose The query string is the part of the URL after a ? question mark. The access token is called a "Bearer" token and goes in the standard To send a custom header using curl, use you the -H flag.

In this example, the product ID is 1337 and the product slug is my-product-v1. You can use either the product ID or the short alphanumerical product slug.
POSTMAN DOWNLOAD M1 CODE
You might code something like /v1/devices/55ff8800beefcafe12345678.įor product endpoints, you need to specify which product the API call targets. PROTOCOL AND HOSTįormatting note: When we write something prefixed with a colon :, we mean you should substitute your own information.įor example when you see something like /v1/devices/:deviceId The variables and functions that you have written in your firmware are exposed as subresources under the device.Īll requests to the device come through our API server using TLS security. In this case, the unique "resource" in question is your device (Core, Photon, Electron).Įvery device has a URL, which can be used to GET variables, POST a function call, or PUT new firmware. REST means a lot of things, but first and foremost it means that we use the URL in the way that it's intended: The Particle Device Cloud API is a REST API.
