> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.bulkneo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Running the examples on Windows

> Why the copy-paste example fails in PowerShell, and the one that works in Command Prompt.

Every example on this site has a **cURL (Windows)** tab. Use that one on Windows — the Mac/Linux tab will not run, and the way it fails is confusing enough to cost you an afternoon.

<Warning>
  **PowerShell's `curl` is not cURL.** It is a built-in alias for `Invoke-WebRequest`, a completely different command that happens to share the name. Pasting a cURL command into PowerShell does not make a bad request — it makes an error message about parameters, before anything reaches the network.
</Warning>

## The two things that break

<AccordionGroup>
  <Accordion title="The backslashes at the end of each line" icon="turn-down">
    In a Mac or Linux shell, a trailing `\` means "this command continues on the next line". Windows Command Prompt has no such thing, so it reads each line as a **separate command** — and all but the first are nonsense.

    That is why the Windows examples are one long line. It looks worse; it works.
  </Accordion>

  <Accordion title="The single quotes around the JSON" icon="quote-left">
    Mac and Linux shells treat `'...'` as "one piece of text, leave it alone". Windows does not treat the single quote as a quoting character at all, so the JSON body arrives torn into fragments.

    On Windows the body has to be wrapped in **double** quotes, with every double quote inside it escaped as `\"`.
  </Accordion>
</AccordionGroup>

## Use Command Prompt

Press **Start**, type `cmd`, and open **Command Prompt**. Paste the **cURL (Windows)** example there, as one line.

```bash cURL (Windows) theme={null}
curl -X POST "https://api.bulkneo.com/v1/messages/text" -H "apikey: YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"instance_id\":\"YOUR_INSTANCE_ID\",\"to\":\"919000000000\",\"text\":\"Hello from our API\"}"
```

<Check>
  cURL has shipped with Windows since Windows 10 version 1803, so there is nothing to install. Check with `curl --version` — if it prints a version number you are ready.
</Check>

## If you would rather stay in PowerShell

Use PowerShell's own command instead of fighting it. `Invoke-RestMethod` builds the JSON for you, so there is no quoting to get wrong:

```powershell PowerShell theme={null}
$body = @{
  instance_id = "YOUR_INSTANCE_ID"
  to          = "919000000000"
  text        = "Hello from our API"
} | ConvertTo-Json

Invoke-RestMethod -Method Post `
  -Uri "https://api.bulkneo.com/v1/messages/text" `
  -Headers @{ apikey = "YOUR_API_KEY" } `
  -ContentType "application/json" `
  -Body $body
```

The backtick `` ` `` at the end of each line is PowerShell's line continuation — its equivalent of the `\` you see in the Mac examples.

<Warning>
  **Calling `curl.exe` explicitly does not fix it.** It is a reasonable thing to try — `curl.exe` really is cURL — but Windows PowerShell rewrites the argument before the program sees it, and the JSON body arrives truncated. The request goes out and comes back as a `400`, which reads like your data was wrong when it was the shell. Command Prompt or `Invoke-RestMethod`; not `curl.exe` in PowerShell.
</Warning>

## What each one looks like when it goes wrong

| What you see | What happened |
| - | - |
| `Cannot bind parameter 'Headers'. Cannot convert the "apikey: ..." value` | You pasted a cURL command into PowerShell. It ran `Invoke-WebRequest`. Use Command Prompt. |
| `'-H' is not recognized as an internal or external command` | The `\` line continuations split one command into several. Use the one-line Windows example. |
| `400 invalid_request` mentioning a field you did send | The JSON body was torn apart by quoting — single quotes in Command Prompt, or any quoting in PowerShell. |
| `curl: (6) Could not resolve host` | The URL was split at a space. Wrap it in double quotes. |

## Putting it in a `.bat` file

If you save a command into a `.bat` file rather than typing it, one more rule applies: a **percent sign** in your message text has to be doubled. `50% off` becomes `50%% off`. At the Command Prompt itself you can type it once.

<Note>
  None of this applies once you are calling the API from code. The [Node.js](/api-reference/messages/text) and [Python](/api-reference/messages/text) examples are identical on every operating system — it is only the shell that differs. If you are building an integration rather than testing one, go straight to those.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.