i created a channel using rest api in twilio,next i am trying to add member to it but i was failed.here is my code
require('Services/Twilio.php');// Find your Account Sid and Token at twilio.com/user/account$sid = "ACCOUNT_SID";$token = "AUTH_TOKEN";// Initialize the client$client = new IPMessaging_Services_Twilio($sid, $token);// Retrieve the service$service = $client->services->get("SERVICE_SID");// Retrieve the channel$channel = $service->channels->get("CHANNEL_ID");// Add the member$member = $channel->members.create(array("identity" => "JOHN",));print $member;
ERROR i am getting :
Fatal error: Call to undefined function create() in twilio/sendsms.php on line 101
if i changed it to
$member = $channel->members->create(array("identity" => "JOHN",));
ERROR : Uncaught exception 'Services_Twilio_RestException' with message 'Missing required parameter Identity in the post body' in twilio/twilio-php-master/Services/Twilio.php:297
Kindly update me on this regard.