I am new to Dwolla and have created my account on sandbox and then created new application in it. I have assigned all permissions to the application. But when I run any request it gives timeout error. Following is my code:
And when I run file with above code, I get following error:
Fatal error: Uncaught exception 'DwollaSwagger\ApiException' with message 'API call to https://api-uat.dwolla.com/customers timed out: a:26:{s:3:"url";s:36:"https://api-uat.dwolla.com/customers";s:12:"content_type";N;s:9:"http_code";i:0;s:11:"header_size";i:0;s:12:"request_size";i:0;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:1;s:14:"redirect_count";i:0;s:10:"total_time";d:0.10899999999999999966693309261245303787291049957275390625;s:15:"namelookup_time";d:0.01499999999999999944488848768742172978818416595458984375;s:12:"connect_time";d:0.04700000000000000011102230246251565404236316680908203125;s:16:"pretransfer_time";d:0;s:11:"size_upload";d:0;s:13:"size_download";d:0;s:14:"speed_download";d:0;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"104.20.47.245";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:13:"192.168.1.187";s:10:"local_port";i:49267;}' in D: in D:\xampp\htdocs\dwolla-swagger-php-master\lib\ApiClient.php on line 298
Please let me know what I need to do here. Thanks in Advance.
spencer
(Spencer Hunter - Lead Developer Advocate @ Dwolla)
2
@Ravi_Mittal, Can you try enabling the debug flag and then reattempt the request? Once you’ve done that, reply back with the updated response.
To enable the debug flag: DwollaSwagger\Configuration::$debug = 1;
Also, make sure you have initialized the client passing in the root of the API $apiClient = new DwollaSwagger\ApiClient("https://api-uat.dwolla.com/");
[DEBUG] HTTP Request body ~BEGIN~ {"firstName":"Ravi","lastName":"Mittal","email":"ravi@dexteroustechnologies.co.in","ipAddress":"99.99.99.99"} ~END~
Warning: curl_setopt(): cannot represent a stream of type Output as a STDIO FILE* in D:\xampp\htdocs\dwolla-swagger-php-master\lib\ApiClient.php on line 276
[DEBUG] HTTP Response body ~BEGIN~ ~END~
Fatal error: Uncaught exception 'DwollaSwagger\ApiException' with message 'API call to https://api-uat.dwolla.com//customers timed out: a:26:{s:3:"url";s:37:"https://api-uat.dwolla.com//customers";s:12:"content_type";N;s:9:"http_code";i:0;s:11:"header_size";i:0;s:12:"request_size";i:0;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:1;s:14:"redirect_count";i:0;s:10:"total_time";d:0.1409999999999999864552790995730902068316936492919921875;s:15:"namelookup_time";d:0.061999999999999999555910790149937383830547332763671875;s:12:"connect_time";d:0.0940000000000000002220446049250313080847263336181640625;s:16:"pretransfer_time";d:0;s:11:"size_upload";d:0;s:13:"size_download";d:0;s:14:"speed_download";d:0;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"104.20.47.245";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:13:"192.168.1.187";s:10:"local_port";i:61096;}' in D:\x in D:\xampp\htdocs\dwolla-swagger-php-master\lib\ApiClient.php on line 298
I tried this curl command curl -X GET -H "Accept: application/vnd.dwolla.v1.hal+json" -H "Content-Type: application/json" -H "Authorization: Bearer y6ILZWALoqNOjQBAwV5uLgF48uUv9PNKRZJHO66dmaZ8htoMYi" -d '{"limit": "10"}' "https://api-uat.dwolla.com/customers" -v
It works fine
But through the php web page call to the API, it still errors out
DwollaSwagger\Configuration::$access_token = 'y6ILZWALoqNOjQBAwV5uLgF48uUv9PNKRZJHO66dmaZ8htoMYi';
$apiClient = new DwollaSwagger\ApiClient("https://api-uat.dwolla.com/");
$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$myCusties = $customersApi->_list(10);
An uncaught Exception was encountered
Type: DwollaSwagger\ApiException
Message: API call to https://api-uat.dwolla.com//customers?limit=10 timed out: a:26:{s:3:"url";s:46:"https://api-uat.dwolla.com//customers?limit=10";s:12:"content_type";N;s:9:"http_code";i:0;s:11:"header_size";i:0;s:12:"request_size";i:0;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:1;s:14:"redirect_count";i:0;s:10:"total_time";d:0.047;s:15:"namelookup_time";d:0;s:12:"connect_time";d:0.032000000000000001;s:16:"pretransfer_time";d:0;s:11:"size_upload";d:0;s:13:"size_download";d:0;s:14:"speed_download";d:0;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"104.20.48.245";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:13:"192.168.1.113";s:10:"local_port";i:57980;}
Filename: \application\libraries\dwollaApi\ApiClient.php
Line Number: 298
@3lots.com There is a small bug with the php sdk that expects the root url that is passed into the DwollaSwagger\ApiClient to not contain an ending slash. We are updating the sdk to remove this assumption. I will post back here when the new version is released.
In the meantime, you can remove the trailing slash from the url and it should work for you.