REST SMS API: PHP Code Samples
- Text Messages
- Sending SMS Messages
- Receiving SMS Messages (Incoming API)
- Inbox
- Keywords
- Credits
- Contacts
- Groups
Text Messages
Sending SMS Messages
Sends SMS text messages to a single phone number or an array of phone numbers. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'PhoneNumbers' => array('2123456785', '2123456786', '2123456787', '2123456788'), 'Groups' => array('honey lovers'), 'Subject' => 'From Winnie', 'Message' => 'I am a Bear of Very Little Brain, and long words bother me', 'StampToSend' => '1305582245', 'MessageTypeID' => 1 ); $curl = curl_init('https://app.grouptexting.com/sending/messages?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $phoneNumbers = array(); foreach( $xml->Entry->PhoneNumbers->children() as $phoneNumber ) { $phoneNumbers[] = (string) $phoneNumber; } $localOptOuts = array(); foreach( $xml->Entry->LocalOptOuts->children() as $phoneNumber ) { $localOptOuts[] = (string) $phoneNumber; } $globalOptOuts = array(); foreach( $xml->Entry->GlobalOptOuts->children() as $phoneNumber ) { $globalOptOuts[] = (string) $phoneNumber; } $groups = array(); foreach( $xml->Entry->Groups->children() as $group ) { $groups[] = (string) $group; } echo 'Status: ' . $xml->Status . "\n" . 'Message ID : ' . $xml->Entry->ID . "\n" . 'Subject: ' . $xml->Entry->Subject . "\n" . 'Message: ' . $xml->Entry->Message . "\n" . 'Message Type ID: ' . $xml->Entry->MessageTypeID . "\n" . 'Total Recipients: ' . $xml->Entry->RecipientsCount . "\n" . 'Credits Charged: ' . $xml->Entry->Credits . "\n" . 'Time To Send: ' . $xml->Entry->StampToSend . "\n" . 'Phone Numbers: ' . implode(', ' , $phoneNumbers) . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'Locally Opted Out Numbers: ' . implode(', ' , $localOptOuts) . "\n" . 'Globally Opted Out Numbers: ' . implode(', ' , $globalOptOuts) . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'PhoneNumbers' => array('2123456785', '2123456786', '2123456787', '2123456788'), 'Groups' => array('honey lovers'), 'Subject' => 'From Winnie', 'Message' => 'I am a Bear of Very Little Brain, and long words bother me', 'StampToSend' => '1305582245', 'MessageTypeID' => 1 ); $curl = curl_init('https://app.grouptexting.com/sending/messages?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $phoneNumbers = array(); if ( !empty($json->Entry->PhoneNumbers) ) { $phoneNumbers = $json->Entry->PhoneNumbers; } $localOptOuts = array(); if ( !empty($json->Entry->LocalOptOuts) ) { $localOptOuts = $json->Entry->LocalOptOuts; } $globalOptOuts = array(); if ( !empty($json->Entry->GlobalOptOuts) ) { $globalOptOuts = $json->Entry->GlobalOptOuts; } $groups = array(); if ( !empty($json->Entry->Groups) ) { $groups = $json->Entry->Groups; } echo 'Status: ' . $json->Status . "\n" . 'Message ID : ' . $json->Entry->ID . "\n" . 'Subject: ' . $json->Entry->Subject . "\n" . 'Message: ' . $json->Entry->Message . "\n" . 'Message Type ID: ' . $json->Entry->MessageTypeID . "\n" . 'Total Recipients: ' . $json->Entry->RecipientsCount . "\n" . 'Credits Charged: ' . $json->Entry->Credits . "\n" . 'Time To Send: ' . $json->Entry->StampToSend . "\n" . 'Phone Numbers: ' . implode(', ' , $phoneNumbers) . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'Locally Opted Out Numbers: ' . implode(', ' , $localOptOuts) . "\n" . 'Globally Opted Out Numbers: ' . implode(', ' , $globalOptOuts) . "\n"; } ?>
Delete An Inbox Message
Delete an incoming text message in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/incoming-messages/123?format=xml&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/incoming-messages/123?format=json&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>
Get All Inbox Messages
Get all incoming text messages in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'sortBy' => 'PhoneNumber', 'sortDir' => 'asc', 'itemsPerPage' => '10', 'page' => '3', ); $curl = curl_init('https://app.grouptexting.com/incoming-messages?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif (! $xml->Entries->children() ) { echo 'Status: ' . $xml->Status . "\n" . 'Search has returned no results' . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Total results: ' . $xml->Entries->children()->count() . "\n\n"; foreach ( $xml->Entries->children() as $message) { echo 'Message ID : ' . $message->ID . "\n" . 'Phone Number: ' . $message->PhoneNumber . "\n" . 'Subject: ' . $message->Subject . "\n" . 'Message: ' . $message->Message . "\n" . 'New: ' . $message->New . "\n" . 'Folder ID: ' . $message->FolderID . "\n" . 'Contact ID: ' . $message->ContactID . "\n" . 'Received On: ' . $message->ReceivedOn . "\n\n"; } } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'sortBy' => 'PhoneNumber', 'sortDir' => 'asc', 'itemsPerPage' => '10', 'page' => '3', ); $curl = curl_init('https://app.grouptexting.com/incoming-messages?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif ( empty($json->Entries) ) { echo 'Status: ' . $json->Status . "\n" . 'Search has returned no results' . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Total results: ' . count($json->Entries) . "\n\n"; foreach ( $json->Entries as $message ) { echo 'Message ID : ' . $message->ID . "\n" . 'Phone Number: ' . $message->PhoneNumber . "\n" . 'Subject: ' . $message->Subject . "\n" . 'Message: ' . $message->Message . "\n" . 'New: ' . $message->New . "\n" . 'Folder ID: ' . $message->FolderID . "\n" . 'Contact ID: ' . $message->ContactID . "\n" . 'Received On: ' . $message->ReceivedOn . "\n\n"; } }
Get One Inbox Message
Get a single incoming text messages in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/incoming-messages/123?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Message ID : ' . $xml->Entry->ID . "\n" . 'Phone Number: ' . $xml->Entry->PhoneNumber . "\n" . 'Subject: ' . $xml->Entry->Subject . "\n" . 'Message: ' . $xml->Entry->Message . "\n" . 'New: ' . $xml->Entry->New . "\n" . 'Folder ID: ' . $xml->Entry->FolderID . "\n" . 'Contact ID: ' . $xml->Entry->ContactID . "\n" . 'Received On: ' . $xml->Entry->ReceivedOn . "\n\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/incoming-messages/123?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Message ID : ' . $json->Entry->ID . "\n" . 'Phone Number: ' . $json->Entry->PhoneNumber . "\n" . 'Subject: ' . $json->Entry->Subject . "\n" . 'Message: ' . $json->Entry->Message . "\n" . 'New: ' . $json->Entry->New . "\n" . 'Folder ID: ' . $json->Entry->FolderID . "\n" . 'Contact ID: ' . $json->Entry->ContactID . "\n" . 'Received On: ' . $json->Entry->ReceivedOn . "\n\n"; } ?>
Move Message(s) To A Folder
Moves an incoming text message in your Group Texting Inbox to a specified folder. Note: You may include multiple Message IDs to move multiple messages to same folder in a single API call.
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'ID' => 12, 'FolderID' => 47 ); $curl = curl_init('https://app.grouptexting.com/incoming-messages/?format=xml&_method=move-to-folder'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'ID' =>gt; array(12, 13), 'FolderID' => 57 ); $curl = curl_init('https://app.grouptexting.com/incoming-messages/?format=json&_method=move-to-folder'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>
Create An Inbox Folder
Create a Folder in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Customers' ); $curl = curl_init('https://app.grouptexting.com/messages-folders?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Folder ID : ' . $xml->Entry->ID . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Customers' ); $curl = curl_init('https://app.grouptexting.com/messages-folders?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Folder ID : ' . $json->Entry->ID . "\n"; } ?>
Update An Inbox Folder
Update the name of a Folder in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Customers' ); $curl = curl_init('https://app.grouptexting.com/messages-folders/123?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if (!empty($response)) { $xml = new SimpleXMLElement($response); if ('Failure' == $xml->Status) { $errors = array(); foreach ($xml->Errors->children() as $error) { $errors[] = (string)$error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ', $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Customers' ); $curl = curl_init('https://app.grouptexting.com/messages-folders/123?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if (!empty($response)) { $json = json_decode($response); $json = $json->Response; if ('Failure' == $json->Status) { $errors = array(); if (!empty($json->Errors)) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ', $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>
Delete An Inbox Folder
Delete a Folder in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/messages-folders/123?format=xml&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/messages-folders/123?format=json&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>
Get All Inbox Folders
Get all Folders in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/messages-folders?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif (! $xml->Entries->children() ) { echo 'Status: ' . $xml->Status . "\n" . 'Search has returned no results' . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Total results: ' . $xml->Entries->children()->count() . "\n\n"; foreach ( $xml->Entries->children() as $folder ) { echo 'ID : ' . $folder->ID . "\n" . 'Name: ' . $folder->Name . "\n"; } } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/messages-folders?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif ( empty($json->Entries) ) { echo 'Status: ' . $json->Status . "\n" . 'Search has returned no results' . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Total results: ' . count($json->Entries) . "\n\n"; foreach ( $json->Entries as $folder ) { echo 'ID : ' . $folder->ID . "\n" . 'Name: ' . $folder->Name . "\n\n"; } } ?>
Get One Inbox Folder
Get a single folder in your Group Texting Inbox
Code Samples
PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/messages-folders/123?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Folder Name: ' . $xml->Entry->Name . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/messages-folders/123?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Folder Name: ' . $json->Entry->Name . "\n"; } ?>
Keywords
Check Keyword Availability
Check whether a Keyword is available to rent on Group Texting PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Keyword' => 'honey' ); $curl = curl_init('https://app.grouptexting.com/keywords/new?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); echo 'Status: ' . $xml->Status . "\n" . 'Keyword: ' . $xml->Entry->Keyword . "\n" . 'Availability: ' . $xml->Entry->Available . "\n"; ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Keyword' => 'honey' ); $curl = curl_init('https://app.grouptexting.com/keywords/new?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); echo 'Status: ' . $json->Response->Status . "\n" . 'Keyword: ' . $json->Response->Entry->Keyword . "\n" . 'Availability: ' . (int) $json->Response->Entry->Available . "\n"; ?>
Rent Keyword
Rents a Keyword for use on Group Texting. You may rent a Keyword using a credit card you have stored in your Group Texting account, or you may pass credit card details when you call the API. Stored Credit CardPHP - XML
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Keyword' => 'honey', 'StoredCreditCard' => '1111' ); $curl = curl_init('https://app.grouptexting.com/keywords?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $groups = array(); foreach( $xml->Entry->ContactGroupIDs->children() as $group ) { $groups[] = (string) $group; } echo 'Status: ' . $xml->Status . "\n" . 'Keyword ID: ' . $xml->Entry->ID . "\n" . 'Keyword: ' . $xml->Entry->Keyword . "\n" . 'Is double opt-in enabled: ' . (int) $xml->Entry->EnableDoubleOptIn . "\n" . 'Confirm message: ' . $xml->Entry->ConfirmMessage . "\n" . 'Join message: ' . $xml->Entry->JoinMessage . "\n" . 'Forward email: ' . $xml->Entry->ForwardEmail . "\n" . 'Forward url: ' . $xml->Entry->ForwardUrl . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n"; } ?>Stored Credit Card
PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Keyword' => 'honey', 'StoredCreditCard' => '1111' ); $curl = curl_init('https://app.grouptexting.com/keywords?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Keyword ID: ' . $json->Entry->ID . "\n" . 'Keyword: ' . $json->Entry->Keyword . "\n" . 'Is double opt-in enabled: ' . (int) $json->Entry->EnableDoubleOptIn . "\n" . 'Confirm message: ' . $json->Entry->ConfirmMessage . "\n" . 'Join message: ' . $json->Entry->JoinMessage . "\n" . 'Forward email: ' . $json->Entry->ForwardEmail . "\n" . 'Forward url: ' . $json->Entry->ForwardUrl . "\n" . 'Groups: ' . implode(', ' , $json->Entry->ContactGroupIDs) . "\n"; } ?>Non-Stored Credit Card
PHP - XML
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Keyword' => 'honey', 'FirstName' => 'Winnie', 'LastName' => 'The Pooh', 'Street' => 'Hollow tree, under the name of Mr. Sanders', 'City' => 'Hundred Acre Woods', 'State' => 'New York', 'Zip' => '12345', 'Country' => 'US', 'CreditCardTypeID' => 'Visa', 'Number' => '4111111111111111', 'SecurityCode' => '123', 'ExpirationMonth' => '10', 'ExpirationYear' => '2017' ); $curl = curl_init('https://app.grouptexting.com/keywords?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); echo 'Status: ' . $xml->Status . "\n" . 'Keyword ID: ' . $xml->Entry->ID . "\n" . 'Keyword: ' . $xml->Entry->Keyword . "\n" . 'Is double opt-in enabled: ' . (int) $xml->Entry->EnableDoubleOptIn . "\n" . 'Confirm message: ' . $xml->Entry->ConfirmMessage . "\n" . 'Join message: ' . $xml->Entry->JoinMessage . "\n" . 'Forward email: ' . $xml->Entry->ForwardEmail . "\n" . 'Forward url: ' . $xml->Entry->ForwardUrl . "\n" . 'Groups: ' . implode(', ' , $xml->Entry->ContactGroupIDs) . "\n"; ?>Non-Stored Credit Card
PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Keyword' => 'honey', 'FirstName' => 'Winnie', 'LastName' => 'The Pooh', 'Street' => 'Hollow tree, under the name of Mr. Sanders', 'City' => 'Hundred Acre Woods', 'State' => 'New York', 'Zip' => '12345', 'Country' => 'US', 'CreditCardTypeID' => 'Visa', 'Number' => '4111111111111111', 'SecurityCode' => '123', 'ExpirationMonth' => '10', 'ExpirationYear' => '2017' ); $curl = curl_init('https://app.grouptexting.com/keywords?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); echo 'Status: ' . $json->Response->Status . "\n" . 'Keyword ID: ' . $json->Response->Entry->ID . "\n" . 'Keyword: ' . $json->Response->Entry->Keyword . "\n" . 'Is double opt-in enabled: ' . (int) $json->Response->Entry->EnableDoubleOptIn . "\n" . 'Confirm message: ' . $json->Response->Entry->ConfirmMessage . "\n" . 'Join message: ' . $json->Response->Entry->JoinMessage . "\n" . 'Forward email: ' . $json->Response->Entry->ForwardEmail . "\n" . 'Forward url: ' . $json->Response->Entry->ForwardUrl . "\n" . 'Groups: ' . implode(', ' , $json->Response->Entry->ContactGroupIDs) . "\n"; ?>
Setup A Keyword
Configures an active Keyword for use on Group Texting PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'EnableDoubleOptIn' => true, 'ConfirmMessage' => 'Reply Y to join our sweetest list', 'JoinMessage' => 'The only reason for being a bee that I know of, is to make honey. And the only reason for making honey, is so as I can eat it.', 'ForwardEmail' => '[email protected]', 'ForwardUrl' => 'http://bear-alliance.co.uk/honey-donations/', 'ContactGroupIDs' => array('honey lovers') ); $curl = curl_init('https://app.grouptexting.com/keywords/honey?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); foreach( $xml->Entry->ContactGroupIDs->children() as $group ) { $groups[] = (string) $group; } echo 'Status: ' . $xml->Status . "\n" . 'Keyword ID: ' . $xml->Entry->ID . "\n" . 'Keyword: ' . $xml->Entry->Keyword . "\n" . 'Is double opt-in enabled: ' . (int) $xml->Entry->EnableDoubleOptIn . "\n" . 'Confirm message: ' . $xml->Entry->ConfirmMessage . "\n" . 'Join message: ' . $xml->Entry->JoinMessage . "\n" . 'Forward email: ' . $xml->Entry->ForwardEmail . "\n" . 'Forward url: ' . $xml->Entry->ForwardUrl . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n"; ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'EnableDoubleOptIn' => true, 'ConfirmMessage' => 'Reply Y to join our sweetest list', 'JoinMessage' => 'The only reason for being a bee that I know of, is to make honey. And the only reason for making honey, is so as I can eat it.', 'ForwardEmail' => '[email protected]', 'ForwardUrl' => 'http://bear-alliance.co.uk/honey-donations/', 'ContactGroupIDs' => array('honey lovers') ); $curl = curl_init('https://app.grouptexting.com/keywords/honey?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); echo 'Status: ' . $json->Response->Status . "\n" . 'Keyword ID: ' . $json->Response->Entry->ID . "\n" . 'Keyword: ' . $json->Response->Entry->Keyword . "\n" . 'Is double opt-in enabled: ' . (int) $json->Response->Entry->EnableDoubleOptIn . "\n" . 'Confirm message: ' . $json->Response->Entry->ConfirmMessage . "\n" . 'Join message: ' . $json->Response->Entry->JoinMessage . "\n" . 'Forward email: ' . $json->Response->Entry->ForwardEmail . "\n" . 'Forward url: ' . $json->Response->Entry->ForwardUrl . "\n" . 'Groups: ' . implode(', ' , $json->Response->Entry->ContactGroupIDs) . "\n"; ?>
Cancel A Keyword
Cancels an active Keyword on Group Texting PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/keywords/honey?format=xml&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_exec($curl); echo 'Status: ' . curl_getinfo($curl, CURLINFO_HTTP_CODE) . "\n"; curl_close($curl); ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/keywords/honey?format=json&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_exec($curl); echo 'Status: ' . curl_getinfo($curl, CURLINFO_HTTP_CODE) . "\n"; curl_close($curl); ?>
Credits
Check Credit Balance
Check whether a Keyword is available to rent on Group Texting PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/billing/credits/get?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); echo 'Status: ' . $xml->Status . "\n" . 'Plan credits: ' . $xml->Entry->PlanCredits . "\n" . 'Anytime credits: ' . $xml->Entry->AnytimeCredits . "\n" . 'Total: ' . $xml->Entry->TotalCredits . "\n"; ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/billing/credits/get?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); echo 'Status: ' . $json->Response->Status . "\n" . 'Plan credits: ' . $json->Response->Entry->PlanCredits . "\n" . 'Anytime credits: ' . $json->Response->Entry->AnytimeCredits . "\n" . 'Total: ' . $json->Response->Entry->TotalCredits . "\n"; ?>
Buy Credits
Buys more credits for your account. You may purchase credits using a credit card you have stored in your Group Texting account, or you may pass credit card details when you call the API. Stored Credit CardPHP - XML
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'NumberOfCredits' => '1000', 'CouponCode' => 'honey2011', 'StoredCreditCard' => '1111' ); $curl = curl_init('https://app.grouptexting.com/billing/credits?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Credits purchased: ' . $xml->Entry->BoughtCredits . "\n" . 'Amount charged, $: ' . sprintf("%01.2f", $xml->Entry->Amount) . "\n" . 'Discount, $: ' . sprintf("%01.2f", $xml->Entry->Discount) . "\n" . 'Plan credits: ' . $xml->Entry->PlanCredits . "\n" . 'Anytime credits: ' . $xml->Entry->AnytimeCredits . "\n" . 'Total: ' . $xml->Entry->TotalCredits . "\n"; } ?>Stored Credit Card
PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'NumberOfCredits' => '1000', 'CouponCode' => 'honey2011', 'StoredCreditCard' => '1111' ); $curl = curl_init('https://app.grouptexting.com/billing/credits?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Credits purchased: ' . $json->Entry->BoughtCredits . "\n" . 'Amount charged, $: ' . sprintf("%01.2f", $json->Entry->Amount) . "\n" . 'Discount, $: ' . sprintf("%01.2f", $json->Entry->Discount) . "\n" . 'Plan credits: ' . $json->Entry->PlanCredits . "\n" . 'Anytime credits: ' . $json->Entry->AnytimeCredits . "\n" . 'Total: ' . $json->Entry->TotalCredits . "\n"; } ?>Non-Stored Credit Card
PHP - XML
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'NumberOfCredits' => '1000', 'CouponCode' => 'honey2011', 'FirstName' => 'Winnie', 'LastName' => 'The Pooh', 'Street' => 'Hollow tree, under the name of Mr. Sanders', 'City' => 'Hundred Acre Woods', 'State' => 'New York', 'Zip' => '12345', 'Country' => 'US', 'CreditCardTypeID' => 'Visa', 'Number' => '4111111111111111', 'SecurityCode' => '123', 'ExpirationMonth' => '10', 'ExpirationYear' => '2017' ); $curl = curl_init('https://app.grouptexting.com/billing/credits?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); echo 'Status: ' . $xml->Status . "\n" . 'Credits purchased: ' . $xml->Entry->BoughtCredits . "\n" . 'Amount charged, $: ' . sprintf("%01.2f", $xml->Entry->Amount) . "\n" . 'Discount, $: ' . sprintf("%01.2f", $xml->Entry->Discount) . "\n" . 'Plan credits: ' . $xml->Entry->PlanCredits . "\n" . 'Anytime credits: ' . $xml->Entry->AnytimeCredits . "\n" . 'Total: ' . $xml->Entry->TotalCredits . "\n"; ?>Non-Stored Credit Card
PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'NumberOfCredits' => '1000', 'CouponCode' => 'honey2011', 'FirstName' => 'Winnie', 'LastName' => 'The Pooh', 'Street' => 'Hollow tree, under the name of Mr. Sanders', 'City' => 'Hundred Acre Woods', 'State' => 'New York', 'Zip' => '12345', 'Country' => 'US', 'CreditCardTypeID' => 'Visa', 'Number' => '4111111111111111', 'SecurityCode' => '123', 'ExpirationMonth' => '10', 'ExpirationYear' => '2017' ); $curl = curl_init('https://app.grouptexting.com/billing/credits?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); echo 'Status: ' . $json->Response->Status . "\n" . 'Credits purchased: ' . $json->Response->Entry->BoughtCredits . "\n" . 'Amount charged, $: ' . sprintf("%01.2f", $json->Response->Entry->Amount) . "\n" . 'Discount, $: ' . sprintf("%01.2f", $json->Response->Entry->Discount) . "\n" . 'Plan credits: ' . $json->Response->Entry->PlanCredits . "\n" . 'Anytime credits: ' . $json->Response->Entry->AnytimeCredits . "\n" . 'Total: ' . $json->Response->Entry->TotalCredits . "\n"; ?>
Contacts
Create A Contact
Adds a new Contact to your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'PhoneNumber' => '2123456785', 'FirstName' => 'Piglet', 'LastName' => 'P.', 'Email' => '[email protected]', 'Note' => 'It is hard to be brave, when you are only a Very Small Animal.', 'Groups' => array('Friends', 'Neighbors') ); $curl = curl_init('https://app.grouptexting.com/contacts?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $groups = array(); foreach( $xml->Entry->Groups->children() as $group ) { $groups[] = (string) $group; } echo 'Status: ' . $xml->Status . "\n" . 'Contact ID : ' . $xml->Entry->ID . "\n" . 'Phone Number: ' . $xml->Entry->PhoneNumber . "\n" . 'First Name: ' . $xml->Entry->FirstName . "\n" . 'Last Name: ' . $xml->Entry->LastName . "\n" . 'Email: ' . $xml->Entry->Email . "\n" . 'Note: ' . $xml->Entry->Note . "\n" . 'Source: ' . $xml->Entry->Source . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $xml->Entry->CreatedAt . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'PhoneNumber' => '2123456785', 'FirstName' => 'Piglet', 'LastName' => 'P.', 'Email' => '[email protected]', 'Note' => 'It is hard to be brave, when you are only a Very Small Animal.', 'Groups' => array('Friends', 'Neighbors') ); $curl = curl_init('https://app.grouptexting.com/contacts?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $groups = array(); if ( !empty($json->Entry->Groups) ) { $groups = $json->Entry->Groups; } echo 'Status: ' . $json->Status . "\n" . 'Contact ID : ' . $json->Entry->ID . "\n" . 'Phone Number: ' . $json->Entry->PhoneNumber . "\n" . 'First Name: ' . $json->Entry->FirstName . "\n" . 'Last Name: ' . $json->Entry->LastName . "\n" . 'Email: ' . $json->Entry->Email . "\n" . 'Note: ' . $json->Entry->Note . "\n" . 'Source: ' . $json->Entry->Source . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $json->Entry->CreatedAt . "\n"; } ?>
Update A Contact
Update a Contact in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'PhoneNumber' => '2123456785', 'FirstName' => 'Piglet', 'LastName' => 'P.', 'Email' => '[email protected]', 'Note' => 'It is hard to be brave, when you are only a Very Small Animal.', 'Groups' => array('Friends', 'Neighbors') ); $curl = curl_init('https://app.grouptexting.com/contacts/4f0b5720734fada368000000?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $groups = array(); foreach( $xml->Entry->Groups->children() as $group ) { $groups[] = (string) $group; } echo 'Status: ' . $xml->Status . "\n" . 'Contact ID : ' . $xml->Entry->ID . "\n" . 'Phone Number: ' . $xml->Entry->PhoneNumber . "\n" . 'First Name: ' . $xml->Entry->FirstName . "\n" . 'Last Name: ' . $xml->Entry->LastName . "\n" . 'Email: ' . $xml->Entry->Email . "\n" . 'Note: ' . $xml->Entry->Note . "\n" . 'Source: ' . $xml->Entry->Source . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $xml->Entry->CreatedAt . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'PhoneNumber' => '2123456785', 'FirstName' => 'Piglet', 'LastName' => 'P.', 'Email' => '[email protected]', 'Note' => 'It is hard to be brave, when you are only a Very Small Animal.', 'Groups' => array('Friends', 'Neighbors') ); $curl = curl_init('https://app.grouptexting.com/contacts/4f0b5720734fada368000000?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $groups = array(); if ( !empty($json->Entry->Groups) ) { $groups = $json->Entry->Groups; } echo 'Status: ' . $json->Status . "\n" . 'Contact ID : ' . $json->Entry->ID . "\n" . 'Phone Number: ' . $json->Entry->PhoneNumber . "\n" . 'First Name: ' . $json->Entry->FirstName . "\n" . 'Last Name: ' . $json->Entry->LastName . "\n" . 'Email: ' . $json->Entry->Email . "\n" . 'Note: ' . $json->Entry->Note . "\n" . 'Source: ' . $json->Entry->Source . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $json->Entry->CreatedAt . "\n"; } ?>
Delete A Contact
Delete a Contact in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/contacts/4f0b52fd734fada068000000?format=xml&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh' ); $curl = curl_init('https://app.grouptexting.com/contacts/4f0b52fd734fada068000000?format=json&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>
Get All Contacts
Return a list of all Contacts in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'source' => 'upload', 'optout' => false, 'group' => 'Honey Lovers', 'sortBy' => 'PhoneNumber', 'sortDir' => 'asc', 'itemsPerPage' => '10', 'page' => '3', ); $curl = curl_init('https://app.grouptexting.com/contacts?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif (! $xml->Entries->children() ) { echo 'Status: ' . $xml->Status . "\n" . 'Search has returned no results' . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Total results: ' . $xml->Entries->children()->count() . "\n\n"; foreach ( $xml->Entries->children() as $contact ) { $groups = array(); foreach( $contact->Groups->children() as $group ) { $groups[] = (string) $group; } echo 'Contact ID : ' . $contact->ID . "\n" . 'Phone Number: ' . $contact->PhoneNumber . "\n" . 'First Name: ' . $contact->FirstName . "\n" . 'Last Name: ' . $contact->LastName . "\n" . 'Email: ' . $contact->Email . "\n" . 'Note: ' . $contact->Note . "\n" . 'Source: ' . $contact->Source . "\n" . 'Opted Out: ' . ($contact->OptOut ? 'true' : 'false') . "\n&ququot; . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $contact->CreatedAt . "\n\n"; } } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'source' => 'upload', 'optout' => false, 'group' => 'Honey Lovers', 'sortBy' => 'PhoneNumber', 'sortDir' => 'asc', 'itemsPerPage' => '10', 'page' => '3', ); $curl = curl_init('https://app.grouptexting.com/contacts?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif ( empty($json->Entries) ) { echo 'Status: ' . $json->Status . "\n" . 'Search has returned no results' . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Total results: ' . count($json->Entries) . "\n\n"; foreach ( $json->Entries as $contact ) { $groups = array(); if ( !empty($contact->Groups) ) { $groups = $contact->Groups; } echo 'Contact ID : ' . $contact->ID . "\n" . 'Phone Number: ' . $contact->PhoneNumber . "\n" . 'First Name: ' . $contact->FirstName . "\n" . 'Last Name: ' . $contact->LastName . "\n" . 'Email: ' . $contact->Email . "\n" . 'Note: ' . $contact->Note . "\n" . 'Source: ' . $contact->Source . "\n" . 'Opted Out: ' . ($contact->OptOut ? 'true' : 'false') . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $contact->CreatedAt . "\n\n"; } } ?>
Get A Contact
Return a single Contact in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/contacts/4f0b52fd734fada068000000?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $groups = array(); foreach( $xml->Entry->Groups->children() as $group ) { $groups[] = (string) $group; } echo 'Status: ' . $xml->Status . "\n" . 'Contact ID : ' . $xml->Entry->ID . "\n" . 'Phone Number: ' . $xml->Entry->PhoneNumber . "\n" . 'First Name: ' . $xml->Entry->FirstName . "\n" . 'Last Name: ' . $xml->Entry->LastName . "\n" . 'Email: ' . $xml->Entry->Email . "\n" . 'Note: ' . $xml->Entry->Note . "\n" . 'Source: ' . $xml->Entry->Source . "\n" . 'Opted Out: ' . ($xml->Entry->OptOut ? 'true' : 'false') . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $xml->Entry->CreatedAt . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/contacts/4f0b52fd734fada068000000?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { $groups = array(); if ( !empty($json->Entry->Groups) ) { $groups = $json->Entry->Groups; } echo 'Status: ' . $json->Status . "\n" . 'Contact ID : ' . $json->Entry->ID . "\n" . 'Phone Number: ' . $json->Entry->PhoneNumber . "\n" . 'First Name: ' . $json->Entry->FirstName . "\n" . 'Last Name: ' . $json->Entry->LastName . "\n" . 'Email: ' . $json->Entry->Email . "\n" . 'Note: ' . $json->Entry->Note . "\n" . 'Source: ' . $json->Entry->Source . "\n" . 'Opted Out: ' . ($json->Entry->OptOut ? 'true' : 'false') . "\n" . 'Groups: ' . implode(', ' , $groups) . "\n" . 'CreatedAt: ' . $json->Entry->CreatedAt . "\n"; } ?>
Groups
Create A Group
Adds a new Group to your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Tubby Bears', 'Note' => 'A bear, however hard he tries, grows tubby without exercise', ); $curl = curl_init('https://app.grouptexting.com/groups?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Group ID : ' . $xml->Entry->ID . "\n" . 'Name: ' . $xml->Entry->Name . "\n" . 'Note: ' . $xml->Entry->Note . "\n" . 'Number of Contacts: ' . $xml->Entry->ContactCount . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Tubby Bears', 'Note' => 'A bear, however hard he tries, grows tubby without exercise', ); $curl = curl_init('https://app.grouptexting.com/groups?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Group ID : ' . $json->Entry->ID . "\n" . 'Name: ' . $json->Entry->Name . "\n" . 'Note: ' . $json->Entry->Note . "\n" . 'Number of Contacts: ' . $json->Entry->ContactCount . "\n"; } ?>
Update A Group
Update a Group in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Tubby Bears', 'Note' => 'A bear, however hard he tries, grows tubby without exercise', ); $curl = curl_init('https://app.grouptexting.com/groups/162467?format=xml'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Group ID : ' . $xml->Entry->ID . "\n" . 'Name: ' . $xml->Entry->Name . "\n" . 'Note: ' . $xml->Entry->Note . "\n" . 'Number of Contacts: ' . $xml->Entry->ContactCount . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'Name' => 'Tubby Bears', 'Note' => 'A bear, however hard he tries, grows tubby without exercise', ); $curl = curl_init('https://app.grouptexting.com/groups/162467?format=json'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Group ID : ' . $json->Entry->ID . "\n" . 'Name: ' . $json->Entry->Name . "\n" . 'Note: ' . $json->Entry->Note . "\n" . 'Number of Contacts: ' . $json->Entry->ContactCount . "\n"; } ?>
Delete A Group
Delete a Group in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/groups/162467?format=xml&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/groups/162467?format=json&_method=DELETE'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); if ( !empty($response) ) { $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } } else { echo 'Status: Success' . "\n"; } ?>
Get All Groups
Return a list of all Groups in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'sortBy' => 'Name', 'sortDir' => 'asc', 'itemsPerPage' => '10', 'page' => '3', ); $curl = curl_init('https://app.grouptexting.com/groups?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif (! $xml->Entries->children() ) { echo 'Status: ' . $xml->Status . "\n" . 'Search has returned no groups' . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Total results: ' . $xml->Entries->children()->count() . "\n\n"; foreach ( $xml->Entries->children() as $group ) { echo 'Group ID : ' . $group->ID . "\n" . 'Name: ' . $group->Name . "\n" . 'Note: ' . $group->Note . "\n" . 'Number of Contacts: ' . $group->ContactCount . "\n\n"; } } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', 'sortBy' => 'Name', 'sortDir' => 'asc', 'itemsPerPage' => '10', 'page' => '3', ); $curl = curl_init('https://app.grouptexting.com/groups?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } elseif ( empty($json->Entries) ) { echo 'Status: ' . $json->Status . "\n" . 'Search has returned no results' . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Total results: ' . count($json->Entries) . "\n\n"; foreach ( $json->Entries as $group ) { echo 'Group ID : ' . $group->ID . "\n" . 'Name: ' . $group->Name . "\n" . 'Note: ' . $group->Note . "\n" . 'Number of Contacts: ' . $group->ContactCount . "\n\n"; } } ?>
Get A Group
Return a single Group in your Group Texting account. PHP - XML<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/groups/162467?format=xml&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $xml = new SimpleXMLElement($response); if ( 'Failure' == $xml->Status ) { $errors = array(); foreach( $xml->Errors->children() as $error ) { $errors[] = (string) $error; } echo 'Status: ' . $xml->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $xml->Status . "\n" . 'Group ID : ' . $xml->Entry->ID . "\n" . 'Name: ' . $xml->Entry->Name . "\n" . 'Note: ' . $xml->Entry->Note . "\n" . 'Number of Contacts: ' . $xml->Entry->ContactCount . "\n"; } ?>PHP - JSON
<?php $data = array( 'User' => 'winnie', 'Password' => 'the-pooh', ); $curl = curl_init('https://app.grouptexting.com/groups/162467?format=json&' . http_build_query($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // If you experience SSL issues, perhaps due to an outdated SSL cert // on your own server, try uncommenting the line below // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); curl_close($curl); $json = json_decode($response); $json = $json->Response; if ( 'Failure' == $json->Status ) { $errors = array(); if ( !empty($json->Errors) ) { $errors = $json->Errors; } echo 'Status: ' . $json->Status . "\n" . 'Errors: ' . implode(', ' , $errors) . "\n"; } else { echo 'Status: ' . $json->Status . "\n" . 'Group ID : ' . $json->Entry->ID . "\n" . 'Name: ' . $json->Entry->Name . "\n" . 'Note: ' . $json->Entry->Note . "\n" . 'Number of Contacts: ' . $json->Entry->ContactCount . "\n"; } ?>