# Api error message

**URL:** <https://community.localwp.com/t/api-error-message/43759>\
**Category:** Support\
**Created:** [July 16, 2024, 4:46pm UTC](https://community.localwp.com/t/api-error-message/43759 "2024-07-16T16:46:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike4](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mike4](https://community.localwp.com/u/Mike4)\
**Post date:** [July 16, 2024, 4:46pm UTC](https://community.localwp.com/t/api-error-message/43759/1 "2024-07-16T16:46:43Z")

</div>

Hi,  
I am trying to use this below:

curl -X GET --user username:password -i [http://yourdomain.com/wp-json/wp/v2/posts?status=draft](http://yourdomain.com/wp-json/wp/v2/posts?status=draft)

But I’ve got an 400 error message (HTTP/1.1 400 Bad request). What could that be? I’ve already tried other so far but this one doesn’t work…

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [July 16, 2024, 6:31pm UTC](https://community.localwp.com/t/api-error-message/43759/2 "2024-07-16T18:31:24Z")

</div>

Are you learning about the WP Rest api from some resource?

When I review the REST API handbook, it looks like the command is close, but slightly different:

```auto
curl --user "USERNAME:PASSWORD" https://HOSTNAME/wp-json/wp/v2/users?context=edit

```

- [Authentication – REST API Handbook | Developer.WordPress.org](https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#basic-authentication-with-application-passwords)

Also, according to the docs, you want to ensure that you have an application password set that you can use.

---

<div class="post-metadata">

**Author:** ![Mike4](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mike4](https://community.localwp.com/u/Mike4)\
**Post date:** [July 18, 2024, 2:01pm UTC](https://community.localwp.com/t/api-error-message/43759/6 "2024-07-18T14:01:03Z")

</div>

![error](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/f/3/f363a5af5918afe582058562be8f96a843c1af0f.png)

I’ve got this error message but I don’t know where that comes from…

---

<div class="post-metadata">

**Author:** ![Mike4](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mike4](https://community.localwp.com/u/Mike4)\
**Post date:** [July 23, 2024, 9:47pm UTC](https://community.localwp.com/t/api-error-message/43759/7 "2024-07-23T21:47:15Z")

</div>

![error 8](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/7/9/79a7a464256bee51b76719299eed00605f2703ad.png)

I am trying to post this on my local site. But the change expected is not displayed. There may bee something to do with the server operator. Does someone know how to resolve this?

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [October 21, 2024, 9:47pm UTC](https://community.localwp.com/t/api-error-message/43759/8 "2024-10-21T21:47:49Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
