# Error 400 on API call

**URL:** <https://forum.mautic.org/t/error-400-on-api-call/3952>\
**Category:** General Discussion\
**Created:** [May 24, 2016, 3:26am UTC](https://forum.mautic.org/t/error-400-on-api-call/3952 "2016-05-24T03:26:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![startfinance](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@startfinance](https://forum.mautic.org/u/startfinance)\
**Post date:** [May 24, 2016, 3:26am UTC](https://forum.mautic.org/t/error-400-on-api-call/3952/1 "2016-05-24T03:26:10Z")

</div>

I want to learn a couple of things about the API so I did a VERY primitive test. I created a couple of plain HTML forms through which I manually catch the Access Token. Which I then manually put in other forms. This works perfectly OK for READ calls, I can list all leads, search for a lead, list users, etc. This all works (i.e I am catching the Access Token OK, the API is enabled etc etc)  
  
  
  
But when trying any WRITE action, it returns a blank JSON with an error 400 code and nothing gets written.  
  
  
  
This is the form I am trying (again, I change the Access Token so that is not the problem)

Code:

  
Is this approach theoretically possible?  
  
Any ideas what is wrong with this POST?  
  
Many, many thanks!

---

<div class="post-metadata">

**Author:** ![startfinance](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@startfinance](https://forum.mautic.org/u/startfinance)\
**Post date:** [May 24, 2016, 3:26am UTC](https://forum.mautic.org/t/error-400-on-api-call/3952/2 "2016-05-24T03:26:10Z")

</div>

I want to learn a couple of things about the API so I did a VERY primitive test. I created a couple of plain HTML forms through which I manually catch the Access Token. Which I then manually put in other forms. This works perfectly OK for READ calls, I can list all leads, search for a lead, list users, etc. This all works (i.e I am catching the Access Token OK, the API is enabled etc etc)

But when trying any WRITE action, it returns a blank JSON with an error 400 code and nothing gets written.

This is the form I am trying (again, I change the Access Token so that is not the problem)

[code]

[/code]

Is this approach theoretically possible?

Any ideas what is wrong with this POST?

Many, many thanks!

---

<div class="post-metadata">

**Author:** ![kr0hmy](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@kr0hmy](https://forum.mautic.org/u/kr0hmy)\
**Post date:** [June 16, 2016, 7:24am UTC](https://forum.mautic.org/t/error-400-on-api-call/3952/3 "2016-06-16T07:24:56Z")

</div>

I had a similar issue, but using the api library. I don’t know if you resolved your issue, but I think the problem come from the input submit.  
When mautic receive a field it doesn’t know, you get the error 400 Bad request.

See my reply in this thread [https://www.mautic.org/community/index.php/conversation/post/12215](https://www.mautic.org/community/index.php/conversation/post/12215)

Hope it helps.
