# Error 400 Api post server side scripting

**URL:** <https://community.dreamfactory.com/t/error-400-api-post-server-side-scripting/4824>\
**Category:** Server-Side Scripting\
**Created:** [March 4, 2019, 5:37pm UTC](https://community.dreamfactory.com/t/error-400-api-post-server-side-scripting/4824 "2019-03-04T17:37:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![knowhat](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@knowhat](https://community.dreamfactory.com/u/knowhat)\
**Post date:** [March 4, 2019, 5:37pm UTC](https://community.dreamfactory.com/t/error-400-api-post-server-side-scripting/4824/1 "2019-03-04T17:37:11Z")

</div>

When trying to post to a API using server-side scripting, I get error 400. When I copy the request to the API Docs, it works.

Here is the error message:

```
{ error:
   { code: 400,
     context: null,
     message: 'No record(s) detected in request. Please make sure record(s) are wrapped in a \'resource\' tag. Example: {&quot;resource&quot;:[{&quot;record&quot;:1},{&quot;record&quot;:2}]}',
     status_code: 400 } }

```

Here is the code:

```auto
var rows = [];
    for (var item in c) {
        rows.push({'id': id, 'id2': parseInt(c[item], 10) });
    }
    platform.api.post(url, {"resource": rows }, null, function(body) {
        var results = JSON.parse(body);
        console.log(results);
    });

```

Any help would be appreciated.
