# ApiException in ApiClient.php line 315: \[400\] Error connecting to the API (https://api-sandbox.dwolla.com/customers)

**URL:** <https://discuss.dwolla.com/t/apiexception-in-apiclient-php-line-315-400-error-connecting-to-the-api-https-api-sandbox-dwolla-com-customers/5182>\
**Category:** API Support\
**Created:** [May 12, 2019, 5:38am UTC](https://discuss.dwolla.com/t/apiexception-in-apiclient-php-line-315-400-error-connecting-to-the-api-https-api-sandbox-dwolla-com-customers/5182 "2019-05-12T05:38:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [May 14, 2019, 4:47pm UTC](https://discuss.dwolla.com/t/apiexception-in-apiclient-php-line-315-400-error-connecting-to-the-api-https-api-sandbox-dwolla-com-customers/5182/5 "2019-05-14T16:47:59Z")

</div>

Hi @shreyas.p,

You should be able to catch the error and get the JSON response-body. You can try wrapping the request in a try/catch and display the error response by calling the getResponseBody() method.

Example:

```auto
try{
    $new_customer = $customersApi->create([
        //request_body   
    ]);
} catch (Exception $e) {
    echo 'Caught exception: ', $e->getResponseBody(), "\n";
}

```

---

_[View the full topic](https://discuss.dwolla.com/t/apiexception-in-apiclient-php-line-315-400-error-connecting-to-the-api-https-api-sandbox-dwolla-com-customers/5182)._
