Skip to content

Instantly share code, notes, and snippets.

@callemall
Created July 31, 2013 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callemall/6123540 to your computer and use it in GitHub Desktop.
Save callemall/6123540 to your computer and use it in GitHub Desktop.
This example invites a phone number to join the text messaging group identified by the keyword "RAMBLES". The SendOptInvitation function is used for this purpose.
// =====================
// account information
// =====================
$username = "999111999";
$pin = "9991";
$firstName = "PersonTo";
$lastName = "Invite";
$invitePhonenumber = "9725551212";
$keyword = "RAMBLES";
$message = "Follow instructs to join my group ";
$YisOK = "0";
$proxy = "http://staging-api.call-em-all.com/webservices/ceaapi_v2.asmx?WSDL";
$client = new SoapClient($proxy, array("trace" => true));
$request = array (
"username" => $username,
"pin" => $pin,
"firstName" => $firstName,
"lastName" => $lastName,
"invitePhonenumber" => $invitePhonenumber,
"keyword" => $keyword,
"message" => $message,
"YisOK" => $YisOK,
);
$response = $client->SendOptInvitation(array("myRequest" => $request));
// =====================
// var_dump($response);
// =====================
print "errorCode :" . $response->SendOptInvitationResult->errorCode . "\n";
print "errorMessage :" . $response->SendOptInvitationResult->errorMessage . "\n";
print "response :" . $response->SendOptInvitationResult->response . "\n";
print "keyword :" . $response->SendOptInvitationResult->keyword . "\n";
print "message :" . $response->SendOptInvitationResult->message . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment