# How to Generate Json Post Request Body? 400 Bad Request

**URL:** <https://community.postman.com/t/how-to-generate-json-post-request-body-400-bad-request/14143>\
**Category:** Help Hub\
**Created:** [July 14, 2020, 8:04pm UTC](https://community.postman.com/t/how-to-generate-json-post-request-body-400-bad-request/14143 "2020-07-14T20:04:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarfaraz.mohammed](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sarfaraz.mohammed](https://community.postman.com/u/sarfaraz.mohammed)\
**Post date:** [July 14, 2020, 8:04pm UTC](https://community.postman.com/t/how-to-generate-json-post-request-body-400-bad-request/14143/1 "2020-07-14T20:04:12Z")

</div>

I am writing API Test scripts for an application for work and I need help on figuring out what goes in to the request body for Posts and Put requests (using raw-JSON).

I have access to the Java classes that have the @Columns defined. I assumed you took those and put them in the request body like so:

{  
“id”: “{{id}}”  
“createdBy”: “{{createdBy}}”  
etc.  
}

However, I am always getting 400 Bad Request. I am new to Postman so I am not sure what exactly goes into the request body or what exactly the API is supposed to return. Anyone have any tips?

---

<div class="post-metadata">

**Author:** ![amenibt](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@amenibt](https://community.postman.com/u/amenibt)\
**Post date:** [October 22, 2020, 3:11pm UTC](https://community.postman.com/t/how-to-generate-json-post-request-body-400-bad-request/14143/2 "2020-10-22T15:11:11Z")

</div>

did you set the id or createdBy in Pre-request Script?
