How do i add a linode instanc using API in windows command prompt

Hi,

I am trying to create a linode using the linode instance API..

curl -v POST "https://api.linode.com/v4/linode/instances" -H "Authorization: Bearer ad0df29385178da8623b5e3f0f9318c3b32a08bf35e06f65" -H "Content-type: application/json" -data '{/'type/': /'g6-standard-1/', /'region/': /'us-west/', /'image/': /'linode/ubuntu24.04/', /'root_pass/': /'Bakul1987/', /'label/': /'parul-api-test/'}'

when i run this via the windows 10 command Prompt i get the following error:-

{"errors": [{"reason": "Invalid JSON"}]}* Connection #1 to host api.linode.com left intact
curl: (3) [globbing] unmatched brace in column 2

<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed</url>
<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed</url>
<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed</url>
<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed</url>
<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed</url>
<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed</url>
<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed</url>
<url> malformed</url>
Closing connection -1 curl: (3) <url> malformed curl: (3) [globbing] unmatched close brace/bracket in column 19</url>
C:\Users\parul>

Please help

2 Replies

@vitapoly_user1 --

You write:

{"errors": [{"reason": "Invalid JSON"}]}* Connection #1 to host api.linode.com left intact
curl: (3) [globbing] unmatched brace in column 2

This should tell you everything. Your request is malformed…probably being munged by the Windoze cmd shell.

-- sw

I pretty sure you’ve got the wrong slash for escaping the quotes (forward-slash instead of backslash.)

If you use double quotes for the -data param, you may not need to escape the singles - i.e.

-data "{'type': 'g6-standard-1'...}"

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct