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:
$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.