简体   繁体   中英

How do I get the conversationId from a RingCentral SMS response?

I am building a simple SMS sending module with the RingCentral WebRTC client in PHP. I can successcully send messages and I get a valid JSON response object, and when I echo it out I can see the conversationId, but I cannot seem to echo it into a variable.

This is my API call:

$resp = $this->platform->post('/account/~/extension/~/sms',
array(
    'from' => array ('phoneNumber' => $this->ringcentral_username),
    'to' => array(array('phoneNumber' => $phone)),
    'text' => $message
));

I can see:

"conversationId" : 1234567890,

in the response object, but $resp->conversationId is not found. How do I pull that out?

I found it:

$resp->json()->conversationId

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM