# PHP in post.PRE\_PROCESS script to modify payload

**URL:** <https://community.dreamfactory.com/t/php-in-post-pre-process-script-to-modify-payload/4749>\
**Category:** REST API\
**Created:** [December 21, 2018, 6:23pm UTC](https://community.dreamfactory.com/t/php-in-post-pre-process-script-to-modify-payload/4749 "2018-12-21T18:23:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@luca](https://community.dreamfactory.com/u/luca)\
**Post date:** [December 21, 2018, 6:23pm UTC](https://community.dreamfactory.com/t/php-in-post-pre-process-script-to-modify-payload/4749/1 "2018-12-21T18:23:16Z")

</div>

Hi I’m using dreamfactory as REST API backend to insert data into mysql database.  
I need to modify my payload befor it will be insert into database. Expecially I nedd to modify my payload from:

{“Time”:“2018-12-21T07:49:23”,“BME680”:{“Temperature”:20.3,“Humidity”:41.8,“Pressure”:1021.1,“Gas”:286.65}

to:

{“Time”:“2018-12-21T07:49:23”,“Temperature”:20.3,“Humidity”:41.8,“Pressure”:1021.1,“Gas”:286.65}

How can I implement a pre\_process script in a post request in php language that can acive my request ?
