# The request body contains bad syntax or is incomplete error found while making a transfer through curl in sandbox

**URL:** <https://discuss.dwolla.com/t/the-request-body-contains-bad-syntax-or-is-incomplete-error-found-while-making-a-transfer-through-curl-in-sandbox/7152>\
**Category:** Transfers\
**Created:** [June 3, 2021, 9:49am UTC](https://discuss.dwolla.com/t/the-request-body-contains-bad-syntax-or-is-incomplete-error-found-while-making-a-transfer-through-curl-in-sandbox/7152 "2021-06-03T09:49:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![symapptest5](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@symapptest5](https://discuss.dwolla.com/u/symapptest5)\
**Post date:** [June 3, 2021, 9:49am UTC](https://discuss.dwolla.com/t/the-request-body-contains-bad-syntax-or-is-incomplete-error-found-while-making-a-transfer-through-curl-in-sandbox/7152/1 "2021-06-03T09:49:57Z")

</div>

Hello,  
I am trying to initiate a transfer with the transfer API in sandbox. I have retrieved source and destination funding sources and prepared the request body. I am facing: The request body contains bad syntax or is incomplete error. My request body is as below:

```auto
$data_string = '{
        "_links": {
            "source": {
                "href": "'.$source.'"
            },
            "destination": {
                href": "'.$dest.'"
            }
        },
        "amount": {
            "currency": "USD",
            "value": "'.$amt.'"
         }
     }';
$ch4 = curl_init("https://api-sandbox.dwolla.com/transfers");
        curl_setopt($ch4, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch4, CURLOPT_POSTFIELDS, $data_string);
        curl_setopt($ch4, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch4, CURLOPT_HTTPHEADER, array(
                           'Content-Type: application/vnd.dwolla.v1.hal+json',
                           'Accept: application/vnd.dwolla.v1.hal+json',
                           'Authorization: Bearer '.$token.'',
                           'Idempotency-Key: '.$myuuid.''
                           )
         );
        $result4 = curl_exec($ch4);
        $result4 = json_decode($result4);

```

Where am I doing wrong? Please help.

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [June 4, 2021, 8:56pm UTC](https://discuss.dwolla.com/t/the-request-body-contains-bad-syntax-or-is-incomplete-error-found-while-making-a-transfer-through-curl-in-sandbox/7152/2 "2021-06-04T20:56:05Z")

</div>

Hi @symapptest5 –

The structure of the JSON request-body looks good to me. Perhaps it could be what’s being populated in the variables `.$source`, `.$dest` or `.$amt` that causing the BadSyntax error.

Are you able to share the raw request and response bodies? If you could share the request-id (from the X-request header) I can look up this request on my end as well and see what’s populating for us in the request-body!
