How to do an API request?

Ok, so I was going through the tutorial to control LEDs found at this link:
https://docs.particle.io/guide/getting-started/examples/core/

and I was confused about the API request thing. It said that this is what the API request will look like:

POST /v1/devices/{DEVICE_ID}/led
        
# EXAMPLE REQUEST IN TERMINAL
# Core ID is 0123456789abcdef
# Your access token is 123412341234
curl https://api.particle.io/v1/devices/0123456789abcdef/led \
-d access_token=123412341234 \
-d params=on

But like, where do you put that code? Yes, I did also look at this:
https://docs.particle.io/reference/api/

It says to write that in the terminal. So does that mean the serial terminal or what? Please help!

You would be putting that in a normal terminal session.
Curl basically calls the web url and returns the data requested. Essentially what a web browser does without the visual, just getting data.

If you’re building the web LED example I recommend using the html form example as it is simple and if you know HTML/CSS you can build a nifty UI as well.

The code for all this is here: https://docs.particle.io/guide/getting-started/examples/photon/

and I’ll post the html code here:

<!-- Replace your-device-ID-goes-here with your actual device ID
and replace your-access-token-goes-here with your actual access token-->
<!DOCTYPE>
<html>
  <body>
  <center>
  <br>
  <br>
  <br>
  <form action="https://api.particle.io/v1/devices/your-device-ID-goes-here/led?access_token=your-access-token-goes-here" method="POST">
    Tell your device what to do!<br>
    <br>
    <input type="radio" name="args" value="on">Turn the LED on.
    <br>
    <input type="radio" name="args" value="off">Turn the LED off.
    <br>
    <br>
    <input type="submit" value="Do it!">
  </form>
  </center>
  </body>
</html>

In case you are not familiar with web stuff, no you won’t need a server or anything to run this page. Simply make a text file, change the name and extension to “index.html” (you don’t have to name it index but that’s pretty standard) and open it with your browser of choice.