esendex/esendex-php-sdk — pull request #4 by jimgolfgti (2014-12-08 22:16:35+00:00)
Title: Load Accounts, Get Message Information, Send Unicode and Improve Bad Request Feedback

The following Services have been added
- AccountService - _use to retrieve your login account, a specific account or all your accounts to check remaining credits, default originator, type etc_ ([docs](http://developers.esendex.com/APIs/REST-API/accounts))
- MessageInformationService - _use to check how many message credits a message will consume when sent. By default the Character Set used is [7bit GSM 03.38](http://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_.2F_GSM_03.38) but may be set to [Unicode](http://en.wikipedia.org/wiki/GSM_03.38#UCS-2_Encoding) or Auto, see [API docs](http://developers.esendex.com/APIs/REST-API/messagesinformation) for more details_

The MessageBodyService and DispatchMessage have been extended to support Unicode messages.
Using the MessageBodyService the return value of all methods is now an Esendex\Model\MessageBody, not a string as before.
This object has a _characterSet_ property which returns either __GSM__ or __Unicode__. The message text can now be read from the _bodyText_ property and for backwards compatibility the _toString_ method also returns the same value.
Therefore the following code will continue to function as before.
```php
$body = $service->getMessageBodyById($someId);
print "The message body was '{$body}'";
```
An additional parameter has been added to DispatchMessage specify the Character Set. It may be set to __GSM__, __Unicode__ or __Auto__, see the [docs](http://developers.esendex.com/APIs/REST-API/messagedispatcher) for more information.
Also the _originator_ is now optional and will default to the Account's default originator. Furthermore when set the value is now validated on send to apply the originator rules for alphanumeric or numeric addresses, this should address #3.

Finally, should something go wrong with an API request if the response body contains something useful, like a _BadRequest_ with `Invalid Account Reference EX102030` in the body, then the Exception message will now contain the response body, previously would have been BadRequestException with message `The requested URL returned error: 400`