Last active
May 12, 2018 00:53
-
-
Save IbrahimTareq/d99f2f4686a14e588232a35a744974e5 to your computer and use it in GitHub Desktop.
MessageMedia Messages PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "vendor/autoload.php"; | |
use MessageMediaMessagesLib\MessageMediaMessagesClient; | |
use MessageMediaMessagesLib\APIHelper; | |
$authUserName = 'YOUR_API_KEY'; // The API key to use with basic/HMAC authentication | |
$authPassword = 'YOUR_API_SECRET'; // The API secret to use with basic/HMAC authentication | |
$useHmacAuthentication = false; // Change to true if you are using HMAC keys | |
$client = new MessageMediaMessagesLib\MessageMediaMessagesClient($authUserName, $authPassword, $useHmacAuthentication); | |
$messages = $client->getMessages(); | |
$bodyValue = '{ | |
"messages":[ | |
{ | |
"content":"My first message", | |
"destination_number":"+61491570156" | |
} | |
] | |
}'; | |
$body = MessageMediaMessagesLib\APIHelper::deserialize($bodyValue); | |
$result = $messages->createSendMessages($body); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment