我需要JSON格式響應這我得到的如何使用PHP SDK從twilio短信API
class Services_Twilio_Rest_Message
我需要在以下JSON發送短信後返回的響應得到JSON格式響應:
{
"sid": "sid",
"date_created": "Tue, 20 Oct 2015 06:01:14 +0000",
"date_updated": "Tue, 20 Oct 2015 06:01:14 +0000",
"date_sent": null,
"account_sid": "AccountSid",
"to": "+91999999999",
"from": "+18989898989",
"body": "I am trying to send a message having characters more than 160. But twilio allows concatenated messages upto 1600 characters length, i thought i should give it a try. So i wrote this weird message.",
"status": "queued",
"num_segments": "2",
"num_media": "0",
"direction": "outbound-api",
"api_version": "2010-04-01",
"price": null,
"price_unit": "USD",
"error_code": null,
"error_message": null,
"uri": "/2010-04-01/Accounts/AccountSid/Messages/SM745b97dcb56a4f9f82c52242ca3b5e92.json",
"subresource_uris": {
"media": "/2010-04-01/Accounts/AccountSid/Messages/SM745b97dcb56a4f9f82c52242ca3b5e92/Media.json"
}
}
我不確定你在問什麼。該API返回JSON,但PHP SDK將其封裝在對象中,以便在應用程序中處理。 – philnash