I am trying to use Plivo sms using php SDK. I am able to send message correctly:
How can i get the Response as in the following link so that i can store it in my Database:
https://api-reference.plivo.com/latest/php/resources/message/the-message-object
Example Response:
{
"error_code": "200",
"from_number": "18552828641",
"message_direction": "outbound",
"message_state": "failed",
"message_time": "2016-08-17 21:26:44+05:30",
"message_type": "sms",
"message_uuid": "85ce8068-6fab-4f0a-9dc7-d6c852cdde91",
"resource_uri": "/v1/Account/{auth_id}/Message/85ce8068-6fab-4f0a-9dc7-d6c852cdde91/",
"to_number": "19352326448",
"total_amount": "0.00000",
"total_rate": "0.00350",
"units": 1
}
For example, I need to know message_state, total_rate etc.
var_dump($message);
gives following results
object(Plivo\Resources\Message\MessageCreateResponse)#32 (2)
{ ["messageUuid":protected]=>
array(1) { [0]=> string(36) "39006dc4-fe7a-11e7-b939-06755d68f0ca" } ["_message":"Plivo\Resources\ResponseUpdate":private]=> string(17) "message(s) queued" }
I tried using $message->message_state
but keep getting errors.
Unfortunately Plivo documentation and support is very poor.
var_dump($message);
? - Ataur Rahman$message->getMessage();
will give you message_state. I hope someone experienced will help you to get details. - Ataur Rahman