PATH:
home
/
lab2454c
/
.trash
/
core
/
vendor
/
messagebird
/
php-rest-api
/
examples
/
conversations
<?php // Sends a message to an existing conversation, with media as its content. // Supported media types are 'audio', 'file', 'image' and 'video. require(__DIR__ . '/../../autoload.php'); $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. $content = new \MessageBird\Objects\Conversation\Content(); $content->image = [ 'url' => 'https://cdn-gc.messagebird.com/assets/images/logo.png' ]; $message = new \MessageBird\Objects\Conversation\Message(); $message->channelId = 'CHANNEL_ID'; $message->content = $content; $message->to = 'RECIPIENT_MSISDN'; $message->type = \MessageBird\Objects\Conversation\Content::TYPE_IMAGE; // 'image' try { // Using a contactId instead of a conversationId is also supported. $conversation = $messageBird->conversationMessages->create( 'CONVERSATION_ID', $message ); var_dump($conversation); } catch (\Exception $e) { echo sprintf("%s: %s", get_class($e), $e->getMessage()); }
[-] enable-whatsapp-sandbox.php
[edit]
[-] message-read.php
[edit]
[+]
..
[-] webhooks-create.php
[edit]
[-] create.php
[edit]
[-] update.php
[edit]
[-] messages-create-text.php
[edit]
[-] webhooks-delete.php
[edit]
[-] create-hsm.php
[edit]
[-] messages-create-location.php
[edit]
[-] send.php
[edit]
[-] webhooks-list.php
[edit]
[-] webhooks-read.php
[edit]
[-] list.php
[edit]
[-] messages-list.php
[edit]
[-] read.php
[edit]
[-] messages-create-media.php
[edit]