Hi
I have the following Json code i need to extract the message ID and status from it
Array
(
[test_mode] => 1
[balance] => 150
[batch_id] => 0
[cost] => 1
[num_messages] => 1
[message] => Array
(
[num_parts] => 1
[sender] => 447777777777
[content] => 447777777777
)
[receipt_url] =>
[custom] =>
[messages] => Array
(
[0] => Array
(
[id] => 1
[recipient] => 0
)
)
[status] => success
)
how would i extract it as i was using the below but i think the API has been updated with a slightly different response.
// Process your response here
$jsonData = json_decode($response);
if ($jsonData->status === 'success') {
// Grab Message ID
foreach($jsonData->messages as $txtid)
{
// Got Message ID
// Success code
echo ('Sent: message to '.$to.' from '.$txtid.'');
}