POST /transfers 400 response - bad request?


(Jam2z9) #1

I’m trying to create a POST to /transfers but am receiving a 400 bad request:

stdClass Object
(
[request] => POST /transfers HTTP/1.0
Authorization: Bearer goMxRhVPTFINIrlqE6BA4fQykyHATfTk0MvAhfB7jvQwoRvCkl
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
User-Agent: Drupal (+http://drupal.org/)
Host: api-uat.dwolla.com
Content-Length:

Array
[data] =>

400 Bad Request

400 Bad Request


cloudflare-nginx [protocol] => HTTP/1.1 [status_message] => Bad Request [headers] => Array ( [server] => cloudflare-nginx [date] => Wed, 13 Jan 2016 23:34:39 GMT [content-type] => text/html [content-length] => 177 [connection] => close ) [code] => 400 [error] => Bad Request )

I’m setting the content-type, authorization, and accept headers and passing it post data of :

 $transfer_post_data = array(
		  '_links' => array(
		      'destination' => array(
		        'href' => 'https://api-uat.dwolla.com/accounts/'. $token_data['account_id'],
		      ),
		      'source' => array(
		        'href' => 'https://api-uat.dwolla.com/funding-sources/' . $fs_id,
		      ),
		    ),
		  'amount' => array(
			  'currency' => 'USD',
			  'value' => '511.00',
		    ),
		);

The destination account id is the uat dwolla account I want the money to be put into… and the $fs_id is the correct ID for the user’s funding source. I retrieved all funding sources with GET “https://api-uat.dwolla.com/accounts/".$token_data[‘account_id’]."/funding-sources” and stored the _embedded verified funding source id into $fs_id.

Any ideas as to why this error is occurring?


(Jam2z9) #2

Disregard this – I figured it out. GIT fails ftl