Examine the Response
Detailed error messages are returned for most API errors within the response body.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?php require_once(__DIR__ . '/SwaggerClient-php/autoload.php'); ultracart\v2\Configuration::getDefaultConfiguration()->setApiKey('x-ultracart-simple-key', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); $api_instance = new ultracart\v2\api\CustomerApi(); $customer_profile_oid = 1234567; // int | The customer oid to retrieve. try { $result = $api_instance->customerCustomersCustomerProfileOidGet($customer_profile_oid); print_r($result); } catch (\ultracart\v2\ApiException $e) { echo 'Exception when calling CustomerApi->customerCustomersCustomerProfileOidGet: ', $e->getMessage(), PHP_EOL; // THE FOLLOWING LINE PROVIDES DETAILED ERROR INFORMATION print_r($e->getResponseObject()); } |
Read the Logs
- Navigate to the API Management page: https://secure.ultracart.com/merchant/configuration/apiManagementApp.do
- Click on the log button for your API key.
- View the response and the request.
- Are you sure you're sending what you think you're sending?
- What does the response say? Is it an error? Is it a valid response? If it is valid, are you consuming it properly?