From 3bd22203e792aac8bb4d9c90f1b104dfc3990e7d Mon Sep 17 00:00:00 2001 From: Karl Lingiah Date: Tue, 11 Oct 2022 15:42:59 +0100 Subject: [PATCH 01/46] Updating WHatsApp template parameters value (#87) --- messages/whatsapp/send-media-mtm.php | 6 +++--- messages/whatsapp/send-mtm.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/messages/whatsapp/send-media-mtm.php b/messages/whatsapp/send-media-mtm.php index aca1823..669cdef 100644 --- a/messages/whatsapp/send-media-mtm.php +++ b/messages/whatsapp/send-media-mtm.php @@ -33,9 +33,9 @@ [ "type" => "body", "parameters" => [ - ["type" => "text", "text" => "Value 1"], - ["type" => "text", "text" => "Value 2"], - ["type" => "text", "text" => "Value 3"], + "Value 1", + "Value 2", + "Value 3", ], ], ], diff --git a/messages/whatsapp/send-mtm.php b/messages/whatsapp/send-mtm.php index 5c32319..2c364c6 100644 --- a/messages/whatsapp/send-mtm.php +++ b/messages/whatsapp/send-mtm.php @@ -12,9 +12,9 @@ $custom = [ "name" => WHATSAPP_TEMPLATE_NAMESPACE . ":" . WHATSAPP_TEMPLATE_NAME, "parameters" => [ - ["default" => "Vonage Verification"], - ["default" => "64873"], - ["default" => "10"], + "Vonage Verification", + "64873", + "10", ], ]; From c9a93fce3db32902b2f38b2cf0321c7d798f3207 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Wed, 17 May 2023 11:33:56 +0100 Subject: [PATCH 02/46] Code snippets for verify2 --- composer.json | 4 ++++ verify2/cancel.php | 11 +++++++++++ verify2/request.php | 13 +++++++++++++ verify2/send_code.php | 16 ++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 verify2/cancel.php create mode 100644 verify2/request.php create mode 100644 verify2/send_code.php diff --git a/composer.json b/composer.json index 1fd6c9d..78044c6 100644 --- a/composer.json +++ b/composer.json @@ -4,4 +4,8 @@ "vlucas/phpdotenv": "^2.5", "lcobucci/jwt": "^3.0" } + , + "require-dev": { + "roave/security-advisories": "dev-latest" + } } diff --git a/verify2/cancel.php b/verify2/cancel.php new file mode 100644 index 0000000..2ad29b2 --- /dev/null +++ b/verify2/cancel.php @@ -0,0 +1,11 @@ +verify2()->cancel($requestId); \ No newline at end of file diff --git a/verify2/request.php b/verify2/request.php new file mode 100644 index 0000000..e66af34 --- /dev/null +++ b/verify2/request.php @@ -0,0 +1,13 @@ +addWorkflow($emailWorkflow); +$client->verify2()->startVerification($newRequest); diff --git a/verify2/send_code.php b/verify2/send_code.php new file mode 100644 index 0000000..4572c95 --- /dev/null +++ b/verify2/send_code.php @@ -0,0 +1,16 @@ +verify2()->check($code); +} catch (\Exception $e) { + var_dump($e->getMessage()); +} From f255108c5f4916868e5cedcae1c960b47480c975 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Thu, 18 May 2023 13:55:03 +0100 Subject: [PATCH 03/46] Change cancel input to constant --- verify2/cancel.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/verify2/cancel.php b/verify2/cancel.php index 2ad29b2..b39e4e4 100644 --- a/verify2/cancel.php +++ b/verify2/cancel.php @@ -7,5 +7,4 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$requestId = 'c11236f4-00bf-4b89-84ba-88b25df97315'; -$client->verify2()->cancel($requestId); \ No newline at end of file +$client->verify2()->cancel(REQUEST_ID); \ No newline at end of file From 9cbb87eb0f545c7c157e27466828b49b23b69cdc Mon Sep 17 00:00:00 2001 From: James Seconde Date: Thu, 18 May 2023 13:59:51 +0100 Subject: [PATCH 04/46] change code to constant --- verify2/send_code.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/verify2/send_code.php b/verify2/send_code.php index 4572c95..3c534ab 100644 --- a/verify2/send_code.php +++ b/verify2/send_code.php @@ -7,10 +7,8 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$code = '1234'; - try { - $client->verify2()->check($code); + $client->verify2()->check(CODE); } catch (\Exception $e) { var_dump($e->getMessage()); } From 4004f338f60eed7a1ec65e05dd7e2e38ad0d921c Mon Sep 17 00:00:00 2001 From: James Seconde Date: Thu, 18 May 2023 14:34:48 +0100 Subject: [PATCH 05/46] change email to constants --- verify2/request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verify2/request.php b/verify2/request.php index e66af34..be59bce 100644 --- a/verify2/request.php +++ b/verify2/request.php @@ -7,7 +7,7 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\SilentAuthRequest('TO_NUMBER', 'my-verification'); -$emailWorkflow = new \Vonage\Verify2\VerifyObjects\VerificationWorkflow(\Vonage\Verify2\VerifyObjects\VerificationWorkflow::WORKFLOW_EMAIL, 'alice@company.com', 'bob@company.com'); +$newRequest = new \Vonage\Verify2\Request\SilentAuthRequest(TO_NUMBER, 'my-verification'); +$emailWorkflow = new \Vonage\Verify2\VerifyObjects\VerificationWorkflow(\Vonage\Verify2\VerifyObjects\VerificationWorkflow::WORKFLOW_EMAIL, TO_EMAIL, FROM_EMAIL); $newRequest->addWorkflow($emailWorkflow); $client->verify2()->startVerification($newRequest); From 07df9ea7b01e1bb4154a33419d7c51d2183e8851 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Wed, 24 May 2023 10:52:10 +0100 Subject: [PATCH 06/46] change to reflect the spec file --- verify2/{cancel.php => cancel-request.php} | 2 ++ .../{send_code.php => check-verification-code.php} | 0 verify2/send-request-email.php | 11 +++++++++++ verify2/send-request-silent-auth.php | 11 +++++++++++ verify2/send-request-sms.php | 11 +++++++++++ verify2/send-request-voice.php | 11 +++++++++++ verify2/send-request-whatsapp-interactive.php | 11 +++++++++++ verify2/send-request-whatsapp.php | 11 +++++++++++ .../{request.php => send-request-with-fallback.php} | 0 9 files changed, 68 insertions(+) rename verify2/{cancel.php => cancel-request.php} (76%) rename verify2/{send_code.php => check-verification-code.php} (100%) create mode 100644 verify2/send-request-email.php create mode 100644 verify2/send-request-silent-auth.php create mode 100644 verify2/send-request-sms.php create mode 100644 verify2/send-request-voice.php create mode 100644 verify2/send-request-whatsapp-interactive.php create mode 100644 verify2/send-request-whatsapp.php rename verify2/{request.php => send-request-with-fallback.php} (100%) diff --git a/verify2/cancel.php b/verify2/cancel-request.php similarity index 76% rename from verify2/cancel.php rename to verify2/cancel-request.php index b39e4e4..e8bc37c 100644 --- a/verify2/cancel.php +++ b/verify2/cancel-request.php @@ -7,4 +7,6 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); +$newRequest = new \Vonage\Verify2\Request\SMSRequest(TO_NUMBER, 'my-verification'); + $client->verify2()->cancel(REQUEST_ID); \ No newline at end of file diff --git a/verify2/send_code.php b/verify2/check-verification-code.php similarity index 100% rename from verify2/send_code.php rename to verify2/check-verification-code.php diff --git a/verify2/send-request-email.php b/verify2/send-request-email.php new file mode 100644 index 0000000..35bac88 --- /dev/null +++ b/verify2/send-request-email.php @@ -0,0 +1,11 @@ +verify2()->startVerification($newRequest); diff --git a/verify2/send-request-silent-auth.php b/verify2/send-request-silent-auth.php new file mode 100644 index 0000000..370bace --- /dev/null +++ b/verify2/send-request-silent-auth.php @@ -0,0 +1,11 @@ +verify2()->startVerification($newRequest); diff --git a/verify2/send-request-sms.php b/verify2/send-request-sms.php new file mode 100644 index 0000000..6d3376a --- /dev/null +++ b/verify2/send-request-sms.php @@ -0,0 +1,11 @@ +verify2()->startVerification($newRequest); diff --git a/verify2/send-request-voice.php b/verify2/send-request-voice.php new file mode 100644 index 0000000..b0d76cc --- /dev/null +++ b/verify2/send-request-voice.php @@ -0,0 +1,11 @@ +verify2()->startVerification($newRequest); diff --git a/verify2/send-request-whatsapp-interactive.php b/verify2/send-request-whatsapp-interactive.php new file mode 100644 index 0000000..0645594 --- /dev/null +++ b/verify2/send-request-whatsapp-interactive.php @@ -0,0 +1,11 @@ +verify2()->startVerification($newRequest); diff --git a/verify2/send-request-whatsapp.php b/verify2/send-request-whatsapp.php new file mode 100644 index 0000000..c059566 --- /dev/null +++ b/verify2/send-request-whatsapp.php @@ -0,0 +1,11 @@ +verify2()->startVerification($newRequest); diff --git a/verify2/request.php b/verify2/send-request-with-fallback.php similarity index 100% rename from verify2/request.php rename to verify2/send-request-with-fallback.php From d9a7241c3ef3624cf089033d9654dd2de22cedd9 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Wed, 7 Jun 2023 10:52:59 +0100 Subject: [PATCH 07/46] remove from email as it's optional --- verify2/send-request-email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify2/send-request-email.php b/verify2/send-request-email.php index 35bac88..eb9e92e 100644 --- a/verify2/send-request-email.php +++ b/verify2/send-request-email.php @@ -7,5 +7,5 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\EmailRequest(TO_EMAIL, 'my-verification', FROM_EMAIL); +$newRequest = new \Vonage\Verify2\Request\EmailRequest(TO_EMAIL, 'my-verification'); $client->verify2()->startVerification($newRequest); From cdb196b1e50f3764eb00bf07a354160bdebb9796 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Wed, 7 Jun 2023 11:48:15 +0100 Subject: [PATCH 08/46] remove from email on fallback --- verify2/send-request-with-fallback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify2/send-request-with-fallback.php b/verify2/send-request-with-fallback.php index be59bce..06ebfe6 100644 --- a/verify2/send-request-with-fallback.php +++ b/verify2/send-request-with-fallback.php @@ -8,6 +8,6 @@ ); $newRequest = new \Vonage\Verify2\Request\SilentAuthRequest(TO_NUMBER, 'my-verification'); -$emailWorkflow = new \Vonage\Verify2\VerifyObjects\VerificationWorkflow(\Vonage\Verify2\VerifyObjects\VerificationWorkflow::WORKFLOW_EMAIL, TO_EMAIL, FROM_EMAIL); +$emailWorkflow = new \Vonage\Verify2\VerifyObjects\VerificationWorkflow(\Vonage\Verify2\VerifyObjects\VerificationWorkflow::WORKFLOW_EMAIL, TO_EMAIL); $newRequest->addWorkflow($emailWorkflow); $client->verify2()->startVerification($newRequest); From 0bab5a2e593611467cd0ddc9f273af83c26950ba Mon Sep 17 00:00:00 2001 From: James Seconde Date: Thu, 13 Jul 2023 09:49:30 +0100 Subject: [PATCH 09/46] bump composer, add create instant room --- composer.json | 2 +- meetings/create-instant-room.php | 10 ++++++++++ meetings/create-long-term-room.php | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 meetings/create-instant-room.php create mode 100644 meetings/create-long-term-room.php diff --git a/composer.json b/composer.json index 41e6b88..0188662 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "require": { - "vonage/client": "^2.3", + "vonage/client": "^4.0", "vlucas/phpdotenv": "^2.5", "lcobucci/jwt": "^4.0" } diff --git a/meetings/create-instant-room.php b/meetings/create-instant-room.php new file mode 100644 index 0000000..c326c5b --- /dev/null +++ b/meetings/create-instant-room.php @@ -0,0 +1,10 @@ +meetings()->createRoom('my_test_room'); \ No newline at end of file diff --git a/meetings/create-long-term-room.php b/meetings/create-long-term-room.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/meetings/create-long-term-room.php @@ -0,0 +1 @@ + Date: Thu, 13 Jul 2023 13:58:27 +0100 Subject: [PATCH 10/46] code snippets for meetings api --- meetings/create-instant-room.php | 4 +++- meetings/create-long-term-room.php | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/meetings/create-instant-room.php b/meetings/create-instant-room.php index c326c5b..40f1c0c 100644 --- a/meetings/create-instant-room.php +++ b/meetings/create-instant-room.php @@ -7,4 +7,6 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$meeting = $client->meetings()->createRoom('my_test_room'); \ No newline at end of file +$room = new \Vonage\Meetings\Room(); +$room->fromArray(['display_name' => 'my_test_room']); +$meeting = $client->meetings()->createRoom($room); \ No newline at end of file diff --git a/meetings/create-long-term-room.php b/meetings/create-long-term-room.php index b3d9bbc..24d0400 100644 --- a/meetings/create-long-term-room.php +++ b/meetings/create-long-term-room.php @@ -1 +1,17 @@ fromArray([ + 'display_name' => 'my_test_room', + 'type' => 'long_term', + 'expires_at' => '2023-01-30T00:47:04+0000' +]); + +$meeting = $client->meetings()->createRoom($room); \ No newline at end of file From cb43bedab500ee985898470a8e8a34f66a4c7808 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Thu, 13 Jul 2023 15:32:10 +0100 Subject: [PATCH 11/46] missing constant --- meetings/create-instant-room.php | 2 +- meetings/create-long-term-room.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meetings/create-instant-room.php b/meetings/create-instant-room.php index 40f1c0c..4f33fe8 100644 --- a/meetings/create-instant-room.php +++ b/meetings/create-instant-room.php @@ -8,5 +8,5 @@ ); $room = new \Vonage\Meetings\Room(); -$room->fromArray(['display_name' => 'my_test_room']); +$room->fromArray(['display_name' => ROOM_DISPLAY_NAME]); $meeting = $client->meetings()->createRoom($room); \ No newline at end of file diff --git a/meetings/create-long-term-room.php b/meetings/create-long-term-room.php index 24d0400..15a5b97 100644 --- a/meetings/create-long-term-room.php +++ b/meetings/create-long-term-room.php @@ -9,7 +9,7 @@ $room = new \Vonage\Meetings\Room(); $room->fromArray([ - 'display_name' => 'my_test_room', + 'display_name' => ROOM_DISPLAY_NAME, 'type' => 'long_term', 'expires_at' => '2023-01-30T00:47:04+0000' ]); From e21fc4be4251e8fc15bcc63339923c29608c5a64 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Wed, 25 Oct 2023 12:44:45 +0100 Subject: [PATCH 12/46] Fix MMS image namespace --- messages/mms/send-mms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/mms/send-mms.php b/messages/mms/send-mms.php index faef737..4e3e015 100644 --- a/messages/mms/send-mms.php +++ b/messages/mms/send-mms.php @@ -14,7 +14,7 @@ 'A MMS image message, with caption, sent using the Vonage Messages API' ); -$mms = new \Vonage\Messages\MessageType\MMS\MMSImage( +$mms = new \Vonage\Messages\Channel\MMS\MMSImage( TO_NUMBER, FROM_NUMBER, $image From e3afbac8939b3bb5a8c457a5e8a85fa72c1ea227 Mon Sep 17 00:00:00 2001 From: Karl Lingiah Date: Thu, 9 Nov 2023 11:28:04 +0000 Subject: [PATCH 13/46] DEVX-7832: Update WhatsApp Media MTM snippet (#95) * Updating WhatsApp Media MTM snippet --- .env-example | 18 +++++++++++++++++- messages/whatsapp/send-media-mtm.php | 15 +++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.env-example b/.env-example index 8360d92..c71e180 100644 --- a/.env-example +++ b/.env-example @@ -31,4 +31,20 @@ REQUEST_ID= WORKFLOW_ID=4 RECIPIENT_NUMBER= PAYEE_NAME= -AMOUNT= \ No newline at end of file +AMOUNT= + +# Messages API examples +FB_SENDER_ID= +FB_RECIPIENT_ID= +VIBER_SERVICE_MESSAGE_ID= +WHATSAPP_NUMBER= +WHATSAPP_TEMPLATE_NAMESPACE= +WHATSAPP_TEMPLATE_NAME= +WHATSAPP_AUTH_TEMPLATE_NAME= +WHATSAPP_TEMPLATE_REPLACEMENT_TEXT= +IMAGE_URL= +IMAGE_CAPTION= +FILE_URL= +FILE_CAPTION= +AUDIO_URL= +VIDEO_URL= diff --git a/messages/whatsapp/send-media-mtm.php b/messages/whatsapp/send-media-mtm.php index 669cdef..5441064 100644 --- a/messages/whatsapp/send-media-mtm.php +++ b/messages/whatsapp/send-media-mtm.php @@ -12,7 +12,6 @@ $custom = [ "type" => "template", "template" => [ - "namespace" => WHATSAPP_TEMPLATE_NAMESPACE, "name" => WHATSAPP_TEMPLATE_NAME, "language" => ["policy" => "deterministic", "code" => "en"], "components" => [ @@ -20,12 +19,9 @@ "type" => "header", "parameters" => [ [ - "type" => "location", - "location" => [ - "longitude" => -122.425332, - "latitude" => 37.758056, - "name" => "Facebook HQ", - "address" => "1 Hacker Way, Menlo Park, CA 94025", + "type" => "image", + "image" => [ + "link" => IMAGE_URL, ], ], ], @@ -33,9 +29,8 @@ [ "type" => "body", "parameters" => [ - "Value 1", - "Value 2", - "Value 3", + "type" => "text", + "text" => WHATSAPP_TEMPLATE_REPLACEMENT_TEXT, ], ], ], From 955695dd9701124678ed0c1b48765355447e92ac Mon Sep 17 00:00:00 2001 From: superchilled Date: Wed, 3 Apr 2024 16:38:56 +0100 Subject: [PATCH 14/46] Adding Messages Sandbox snippets --- .env-example | 8 ++++++++ messages/sandbox/messenger/send-text.php | 21 +++++++++++++++++++++ messages/sandbox/viber/send-text.php | 21 +++++++++++++++++++++ messages/sandbox/whatsapp/send-text.php | 21 +++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 messages/sandbox/messenger/send-text.php create mode 100644 messages/sandbox/viber/send-text.php create mode 100644 messages/sandbox/whatsapp/send-text.php diff --git a/.env-example b/.env-example index c71e180..a4c724a 100644 --- a/.env-example +++ b/.env-example @@ -48,3 +48,11 @@ FILE_URL= FILE_CAPTION= AUDIO_URL= VIDEO_URL= + +## For Messages Sandbox +MESSAGES_SANDBOX_URL= +MESSAGES_SANDBOX_WHATSAPP_NUMBER= +MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER= +MESSAGES_SANDBOX_FB_ID= +MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID= +MESSAGES_SANDBOX_VIBER_SERVICE_ID= \ No newline at end of file diff --git a/messages/sandbox/messenger/send-text.php b/messages/sandbox/messenger/send-text.php new file mode 100644 index 0000000..653345d --- /dev/null +++ b/messages/sandbox/messenger/send-text.php @@ -0,0 +1,21 @@ + MESSAGES_SANDBOX_URL + ] +); + +$message = new \Vonage\Messages\MessageType\Messenger\MessengerText( + MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID, + MESSAGES_SANDBOX_FB_ID, + 'This is a Messenger text message sent using the Vonage PHP SDK via the Messages Sandbox' +); diff --git a/messages/sandbox/viber/send-text.php b/messages/sandbox/viber/send-text.php new file mode 100644 index 0000000..6f61a24 --- /dev/null +++ b/messages/sandbox/viber/send-text.php @@ -0,0 +1,21 @@ + MESSAGES_SANDBOX_URL + ] +); + +$viber = new \Vonage\Messages\MessageType\Viber\ViberText( + MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER, + MESSAGES_SANDBOX_VIBER_SERVICE_ID, + 'This is a Viber text message sent using the Vonage PHP SDK via the Messages Sandbox' +); diff --git a/messages/sandbox/whatsapp/send-text.php b/messages/sandbox/whatsapp/send-text.php new file mode 100644 index 0000000..f771dde --- /dev/null +++ b/messages/sandbox/whatsapp/send-text.php @@ -0,0 +1,21 @@ + MESSAGES_SANDBOX_URL + ] +); + +$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppText( + MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER, + MESSAGES_SANDBOX_WHATSAPP_NUMBER, + 'This is a WhatsApp text message sent using the Vonage PHP SDK via the Messages Sandbox via the Messages Sandbox' +); From 99c66667131c302d96e732b1226d8dd305ea5e59 Mon Sep 17 00:00:00 2001 From: superchilled Date: Wed, 3 Apr 2024 16:44:22 +0100 Subject: [PATCH 15/46] Revert "Adding Messages Sandbox snippets" This reverts commit 955695dd9701124678ed0c1b48765355447e92ac. --- .env-example | 8 -------- messages/sandbox/messenger/send-text.php | 21 --------------------- messages/sandbox/viber/send-text.php | 21 --------------------- messages/sandbox/whatsapp/send-text.php | 21 --------------------- 4 files changed, 71 deletions(-) delete mode 100644 messages/sandbox/messenger/send-text.php delete mode 100644 messages/sandbox/viber/send-text.php delete mode 100644 messages/sandbox/whatsapp/send-text.php diff --git a/.env-example b/.env-example index a4c724a..c71e180 100644 --- a/.env-example +++ b/.env-example @@ -48,11 +48,3 @@ FILE_URL= FILE_CAPTION= AUDIO_URL= VIDEO_URL= - -## For Messages Sandbox -MESSAGES_SANDBOX_URL= -MESSAGES_SANDBOX_WHATSAPP_NUMBER= -MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER= -MESSAGES_SANDBOX_FB_ID= -MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID= -MESSAGES_SANDBOX_VIBER_SERVICE_ID= \ No newline at end of file diff --git a/messages/sandbox/messenger/send-text.php b/messages/sandbox/messenger/send-text.php deleted file mode 100644 index 653345d..0000000 --- a/messages/sandbox/messenger/send-text.php +++ /dev/null @@ -1,21 +0,0 @@ - MESSAGES_SANDBOX_URL - ] -); - -$message = new \Vonage\Messages\MessageType\Messenger\MessengerText( - MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID, - MESSAGES_SANDBOX_FB_ID, - 'This is a Messenger text message sent using the Vonage PHP SDK via the Messages Sandbox' -); diff --git a/messages/sandbox/viber/send-text.php b/messages/sandbox/viber/send-text.php deleted file mode 100644 index 6f61a24..0000000 --- a/messages/sandbox/viber/send-text.php +++ /dev/null @@ -1,21 +0,0 @@ - MESSAGES_SANDBOX_URL - ] -); - -$viber = new \Vonage\Messages\MessageType\Viber\ViberText( - MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER, - MESSAGES_SANDBOX_VIBER_SERVICE_ID, - 'This is a Viber text message sent using the Vonage PHP SDK via the Messages Sandbox' -); diff --git a/messages/sandbox/whatsapp/send-text.php b/messages/sandbox/whatsapp/send-text.php deleted file mode 100644 index f771dde..0000000 --- a/messages/sandbox/whatsapp/send-text.php +++ /dev/null @@ -1,21 +0,0 @@ - MESSAGES_SANDBOX_URL - ] -); - -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppText( - MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER, - MESSAGES_SANDBOX_WHATSAPP_NUMBER, - 'This is a WhatsApp text message sent using the Vonage PHP SDK via the Messages Sandbox via the Messages Sandbox' -); From e19dbc672aa9904dd2f0edd74eafff8334e38538 Mon Sep 17 00:00:00 2001 From: Karl Lingiah Date: Tue, 9 Apr 2024 15:58:27 +0100 Subject: [PATCH 16/46] Adding Messages Sandbox snippets (#98) * Adding MEssages Sandbox snippets * add send method * add send method * add send method --------- Co-authored-by: James Seconde --- .env-example | 8 ++++++++ messages/sandbox/messenger/send-text.php | 23 +++++++++++++++++++++++ messages/sandbox/viber/send-text.php | 23 +++++++++++++++++++++++ messages/sandbox/whatsapp/send-text.php | 23 +++++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 messages/sandbox/messenger/send-text.php create mode 100644 messages/sandbox/viber/send-text.php create mode 100644 messages/sandbox/whatsapp/send-text.php diff --git a/.env-example b/.env-example index c71e180..e43e6ba 100644 --- a/.env-example +++ b/.env-example @@ -48,3 +48,11 @@ FILE_URL= FILE_CAPTION= AUDIO_URL= VIDEO_URL= + +## For Messages Sandbox +MESSAGES_SANDBOX_URL= +MESSAGES_SANDBOX_WHATSAPP_NUMBER= +MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER= +MESSAGES_SANDBOX_FB_ID= +MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID= +MESSAGES_SANDBOX_VIBER_SERVICE_ID= diff --git a/messages/sandbox/messenger/send-text.php b/messages/sandbox/messenger/send-text.php new file mode 100644 index 0000000..77461dd --- /dev/null +++ b/messages/sandbox/messenger/send-text.php @@ -0,0 +1,23 @@ + MESSAGES_SANDBOX_URL + ] +); + +$message = new \Vonage\Messages\MessageType\Messenger\MessengerText( + MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID, + MESSAGES_SANDBOX_FB_ID, + 'This is a Messenger text message sent using the Vonage PHP SDK via the Messages Sandbox' +); + +$response = $client->messages()->send($message); diff --git a/messages/sandbox/viber/send-text.php b/messages/sandbox/viber/send-text.php new file mode 100644 index 0000000..4a1f8ab --- /dev/null +++ b/messages/sandbox/viber/send-text.php @@ -0,0 +1,23 @@ + MESSAGES_SANDBOX_URL + ] +); + +$viber = new \Vonage\Messages\MessageType\Viber\ViberText( + MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER, + MESSAGES_SANDBOX_VIBER_SERVICE_ID, + 'This is a Viber text message sent using the Vonage PHP SDK via the Messages Sandbox' +); + +$response = $client->messages()->send($message); diff --git a/messages/sandbox/whatsapp/send-text.php b/messages/sandbox/whatsapp/send-text.php new file mode 100644 index 0000000..cb788e3 --- /dev/null +++ b/messages/sandbox/whatsapp/send-text.php @@ -0,0 +1,23 @@ + MESSAGES_SANDBOX_URL + ] +); + +$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppText( + MESSAGES_SANDBOX_ALLOW_LISTED_TO_NUMBER, + MESSAGES_SANDBOX_WHATSAPP_NUMBER, + 'This is a WhatsApp text message sent using the Vonage PHP SDK via the Messages Sandbox via the Messages Sandbox' +); + +$response = $client->messages()->send($message); From 96c01f3f1cd3a25366aaf697a68f667fd1fe5123 Mon Sep 17 00:00:00 2001 From: James Seconde Date: Tue, 30 Apr 2024 10:24:00 +0100 Subject: [PATCH 17/46] Update verify-webhook.php --- messages/signed-webhooks/verify-webhook.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/messages/signed-webhooks/verify-webhook.php b/messages/signed-webhooks/verify-webhook.php index ccd7fd0..f57a71c 100644 --- a/messages/signed-webhooks/verify-webhook.php +++ b/messages/signed-webhooks/verify-webhook.php @@ -14,5 +14,5 @@ $client->sms()->send($message); // Incoming Request -$signature = new Vonage\Client\Signature(VONAGE_API_KEY, VONAGE_SIGNATURE_SECRET, 'sha256'); -$isValid = $signature->check($_GET['sig']); \ No newline at end of file +$signature = new Vonage\Client\Signature($_GET, VONAGE_SIGNATURE_SECRET, 'sha256'); +$isValid = $signature->check($_GET['sig']); From 74361972b1a1656b423252ed6901c6c03e90948a Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Mon, 19 Aug 2024 21:07:22 +0100 Subject: [PATCH 18/46] Added code snippets for revoking a message and sending rcs messages --- messages/rcs/revoke-message.php | 15 +++++++++++++++ messages/rcs/send-file.php | 21 +++++++++++++++++++++ messages/rcs/send-image.php | 21 +++++++++++++++++++++ messages/rcs/send-text.php | 19 +++++++++++++++++++ messages/rcs/send-video.php | 21 +++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 messages/rcs/revoke-message.php create mode 100644 messages/rcs/send-file.php create mode 100644 messages/rcs/send-image.php create mode 100644 messages/rcs/send-text.php create mode 100644 messages/rcs/send-video.php diff --git a/messages/rcs/revoke-message.php b/messages/rcs/revoke-message.php new file mode 100644 index 0000000..af31a35 --- /dev/null +++ b/messages/rcs/revoke-message.php @@ -0,0 +1,15 @@ +messages()->updateRcsStatus($messageUuid, \Vonage\Messages\Client::RCS_STATUS_REVOKED); diff --git a/messages/rcs/send-file.php b/messages/rcs/send-file.php new file mode 100644 index 0000000..ad2088f --- /dev/null +++ b/messages/rcs/send-file.php @@ -0,0 +1,21 @@ +messages()->send($rcsFile); diff --git a/messages/rcs/send-image.php b/messages/rcs/send-image.php new file mode 100644 index 0000000..26c810a --- /dev/null +++ b/messages/rcs/send-image.php @@ -0,0 +1,21 @@ +messages()->send($rcsImage); diff --git a/messages/rcs/send-text.php b/messages/rcs/send-text.php new file mode 100644 index 0000000..61b1de0 --- /dev/null +++ b/messages/rcs/send-text.php @@ -0,0 +1,19 @@ +messages()->send($rcsText); diff --git a/messages/rcs/send-video.php b/messages/rcs/send-video.php new file mode 100644 index 0000000..f19acf5 --- /dev/null +++ b/messages/rcs/send-video.php @@ -0,0 +1,21 @@ +messages()->send($rcsImage); From 538f35d855e17b2f33d52b3dad16e3175626779d Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Thu, 5 Sep 2024 15:25:21 +0100 Subject: [PATCH 19/46] Change license to Apache 2, remove Nexmo references --- LICENSE.md | 223 +++++++++++++++++++++++++++++++++++++++++++----- README.md | 11 ++- vonage_logo.png | Bin 0 -> 17841 bytes 3 files changed, 207 insertions(+), 27 deletions(-) create mode 100644 vonage_logo.png diff --git a/LICENSE.md b/LICENSE.md index d046301..29a9fad 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,21 +1,202 @@ -The MIT License (MIT) - -Copyright (c) 2019 Nexmo Community - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index a7dae11..f9441c2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Vonage APIs Quickstart Examples for PHP -Nexmo is now known as Vonage +Vonage logo The purpose of the quickstart guide is to provide simple PHP examples focused on one goal. For example, sending an SMS, receiving an SMS via an incoming SMS webhook or making a Text to Speech call. @@ -8,7 +8,7 @@ Quickstarts also available for [Java](https://github.com/nexmo/nexmo-java-code-s ## Setup -These code samples are meant to be used for [https://developer.nexmo.com/](https://developer.nexmo.com/), and are structured in such a way as to be used for internal testing. Developers are free to use these code snippets as a reference, but these may require changes to be worked into your specific application. We recommend checking out the [Vonage Developer Website](https://developer.nexmo.com/), which displays these code snippets in a more copy/paste fashion. +These code samples are meant to be used for [https://developer.vonage.com/](https://developer.vonage.com/), and are structured in such a way as to be used for internal testing. Developers are free to use these code snippets as a reference, but these may require changes to be worked into your specific application. We recommend checking out the [Vonage Developer Website](https://developer.vonage.com/), which displays these code snippets in a more copy/paste fashion. If you would like to run these examples yourself, you will need to do the following: @@ -22,10 +22,10 @@ Larger or more complex snippets may include their own `composer.json` file and h ## Configure with Your Vonage API Keys -To use this sample you will first need a [Vonage account](https://dashboard.nexmo.com/sign-up). Once you have your own API credentials, rename +To use this sample you will first need a [Vonage account](https://dashboard.vonage.com/sign-up). Once you have your own API credentials, rename the `.env-example` file to `.env` and set the values as required. -For some of the examples, you will need to [buy a number](https://dashboard.nexmo.com/buy-numbers). +For some of the examples, you will need to [buy a number](https://dashboard.vonage.com/buy-numbers). ## Request More Examples @@ -33,6 +33,5 @@ Please [raise an issue](/../../issues/) to request an example that isn't present ## Licenses -- The sample code in this repo is licensed under [MIT](LICENSE.md) +- The sample code in this repo is licensed under [Apache2](LICENSE.md) - ​ diff --git a/vonage_logo.png b/vonage_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..755eef3acf16a42bab4d628e6b0539e9e5d57d41 GIT binary patch literal 17841 zcmX_HWmsEHu%=L);>C))OK>j~2u^V=1P$))6e}*lwJk2i-HK~~Qrz9$q1a9P-Ftu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5B-vq|AUc>=&jD#`Ag zn&i%uZL{^tAFy_Nt4${+?zwfY6{=l6^3HpYxT&96Zos;|t|K=Z8 zfEFIHgc(>m^99hrkJX!C2G*TmOh0}5_Daw>4jdEfN|JYOe$(uH73$tB<4ZHEe+NHV z0XiW8D1FDHQMqz!%sWVExcilv*+v}bg&QvUJg2HaWh?lQh87QVqn+JO?w?*M`vt+` z>+zYG68-x@kkI*?aat$+a&!ICUC^+0^Zn;IQ@PT#+YA~U(vg4of6Ja+?f(*(;z1Gl z>*D;geNV2|)w#4m^&C5?Q#9??&%(;>ppE!Se>2XSq<7zrU$hfuCiB17IfcKSD&xVa z|L=;U$|Ba2!n1b-KoVNXVyXY98G+qpZf97KRDKQq28>1P9TRm*8$s5ptUvVY^z*V+ zE4U${@JZ`FFi?-{Pmyp3rTLd`y8o_6e#uhb?i~lVwyFun%>gG9@+Gl+I+jdL$SkMs?9bXoSnSbt7E-Y;jEC~}K>n-C~wpm0$J$%POv{V4jt3fFyL4JJNk6-C{>(jRwYW@|fKC2& zGJ4jB>Z%JpY#Y0d*1k#L25lVHc_eHWxayz^$a~Fy>P4po@ZVXk=L0;#M76{2OC7#SE^>KYp98kvO{8Cn@xS{WH@8yHv_7_3zAjzH0no1c=IR*74~joQyo QfEpM)UHx3vIVCg!0M`B$q5uE@ literal 0 HcmV?d00001 From c5210369734b88c626f305cc05ab1940032adf68 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Mon, 16 Sep 2024 09:58:46 +0100 Subject: [PATCH 20/46] add project workfiles to git ignore --- .idea/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml From 5216fac56ae49a44fac001ca0ade4b36c2bed030 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Mon, 16 Sep 2024 09:59:26 +0100 Subject: [PATCH 21/46] add project workfiles to git ignore --- .gitignore | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index 98b9c68..2cdee93 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,14 @@ private.key .env composer.lock .DS_Store +/.idea/codeception.xml +/.idea/deployment.xml +/img.png +/.idea/material_theme_project_new.xml +/.idea/modules.xml +/.idea/php.xml +/.idea/phpspec.xml +/.idea/phpunit.xml +/.idea/symfony2.xml +/.idea/vcs.xml +/.idea/vonage-php-code-snippets.iml From cfedca558a2c47f012b866807b6f049061158a08 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Mon, 16 Sep 2024 11:15:28 +0100 Subject: [PATCH 22/46] add custom template fragments --- verify2/create-template-fragment.php | 16 ++++++++++++++++ verify2/create-template.php | 10 ++++++++++ verify2/delete-fragment.php | 10 ++++++++++ verify2/delete-template.php | 10 ++++++++++ verify2/update-template-fragment.php | 14 ++++++++++++++ verify2/update-template.php | 12 ++++++++++++ 6 files changed, 72 insertions(+) create mode 100644 verify2/create-template-fragment.php create mode 100644 verify2/create-template.php create mode 100644 verify2/delete-fragment.php create mode 100644 verify2/delete-template.php create mode 100644 verify2/update-template-fragment.php create mode 100644 verify2/update-template.php diff --git a/verify2/create-template-fragment.php b/verify2/create-template-fragment.php new file mode 100644 index 0000000..4c40f6c --- /dev/null +++ b/verify2/create-template-fragment.php @@ -0,0 +1,16 @@ +verify2()->createCustomTemplateFragment(TEMPLATE_ID, $createFragmentRequest); diff --git a/verify2/create-template.php b/verify2/create-template.php new file mode 100644 index 0000000..ecb1f6b --- /dev/null +++ b/verify2/create-template.php @@ -0,0 +1,10 @@ +verify2()->createCustomTemplate('my-custom-template'); \ No newline at end of file diff --git a/verify2/delete-fragment.php b/verify2/delete-fragment.php new file mode 100644 index 0000000..ed8bcce --- /dev/null +++ b/verify2/delete-fragment.php @@ -0,0 +1,10 @@ +verify2()->deleteCustomTemplateFragment(TEMPLATE_ID, TEMPLATE_FRAGMENT_ID); diff --git a/verify2/delete-template.php b/verify2/delete-template.php new file mode 100644 index 0000000..a610384 --- /dev/null +++ b/verify2/delete-template.php @@ -0,0 +1,10 @@ +verify2()->deleteCustomTemplate(TEMPLATE_ID); diff --git a/verify2/update-template-fragment.php b/verify2/update-template-fragment.php new file mode 100644 index 0000000..8bfd297 --- /dev/null +++ b/verify2/update-template-fragment.php @@ -0,0 +1,14 @@ +verify2()->updateCustomTemplateFragment( + TEMPLATE_ID, + TEMPLATE_FRAGMENT_ID, + 'The authentication code for your ${brand} is: ${code}' +); diff --git a/verify2/update-template.php b/verify2/update-template.php new file mode 100644 index 0000000..ceec4e7 --- /dev/null +++ b/verify2/update-template.php @@ -0,0 +1,12 @@ +verify2()->updateCustomTemplate(TEMPLATE_ID, $updateRequest); From aa50cc026f38828d1fddef0441a58b47d46e8eaa Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Thu, 19 Sep 2024 16:53:48 +0100 Subject: [PATCH 23/46] add language to talk action --- voice/play-tts-in-to-call/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/voice/play-tts-in-to-call/index.php b/voice/play-tts-in-to-call/index.php index 248ac38..421e91e 100644 --- a/voice/play-tts-in-to-call/index.php +++ b/voice/play-tts-in-to-call/index.php @@ -4,8 +4,10 @@ $keypair = new \Vonage\Client\Credentials\Keypair(file_get_contents(VONAGE_APPLICATION_PRIVATE_KEY_PATH), VONAGE_APPLICATION_ID); $client = new \Vonage\Client($keypair); +$action = new \Vonage\Voice\NCCO\Action\Talk(TEXT); +$action->setLanguage('en-US'); $client->voice()->playTTS( UUID, - new \Vonage\Voice\NCCO\Action\Talk(TEXT) + $action ); From 1c739aabf390c95a4dfeac608dbbcd63af88b763 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Wed, 25 Sep 2024 16:14:08 +0100 Subject: [PATCH 24/46] Change download recording method in voice download snippet --- voice/download-a-recording/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voice/download-a-recording/index.php b/voice/download-a-recording/index.php index 116acc4..f685f0d 100644 --- a/voice/download-a-recording/index.php +++ b/voice/download-a-recording/index.php @@ -6,5 +6,5 @@ $client = new \Vonage\Client($keypair); $recordingUrl = 'https://api.nexmo.com/v1/files/'.VONAGE_RECORDING_ID; -$data = $client->get($recordingUrl); -file_put_contents($recordingId.'.mp3', $data->getBody()); +$data = $client->voice()->getRecording($recordingUrl); +file_put_contents(VONAGE_RECORDING_ID .'.mp3', $data->getBody()); From bb80d962494379de16252fa001e36b49c779dd5b Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Tue, 8 Oct 2024 10:35:19 +0100 Subject: [PATCH 25/46] Add get endpoints for custom templates --- verify2/get-fragment.php | 10 ++++++++++ verify2/get-template.php | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 verify2/get-fragment.php create mode 100644 verify2/get-template.php diff --git a/verify2/get-fragment.php b/verify2/get-fragment.php new file mode 100644 index 0000000..0ce4c52 --- /dev/null +++ b/verify2/get-fragment.php @@ -0,0 +1,10 @@ +verify2()->getCustomTemplateFragment(TEMPLATE_ID, TEMPLATE_FRAGMENT_ID); diff --git a/verify2/get-template.php b/verify2/get-template.php new file mode 100644 index 0000000..ffef848 --- /dev/null +++ b/verify2/get-template.php @@ -0,0 +1,10 @@ +verify2()->getCustomTemplate(TEMPLATE_ID); From 1a6048d44aa61af3a01ca8e71a19976eb6a363c5 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Tue, 15 Oct 2024 09:59:00 +0100 Subject: [PATCH 26/46] Added lists --- verify2/list-fragments.php | 10 ++++++++++ verify2/list-templates.php | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 verify2/list-fragments.php create mode 100644 verify2/list-templates.php diff --git a/verify2/list-fragments.php b/verify2/list-fragments.php new file mode 100644 index 0000000..c71c539 --- /dev/null +++ b/verify2/list-fragments.php @@ -0,0 +1,10 @@ +verify2()->listTemplateFragments(TEMPLATE_ID); diff --git a/verify2/list-templates.php b/verify2/list-templates.php new file mode 100644 index 0000000..bb0d3ef --- /dev/null +++ b/verify2/list-templates.php @@ -0,0 +1,10 @@ +verify2()->listCustomTemplates(TEMPLATE_ID); From 2ada725ab6690545d30d2d7d0ff460ab458ccb6d Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Tue, 15 Oct 2024 14:32:19 +0100 Subject: [PATCH 27/46] Added RCS snippets for custom cards --- messages/rcs/send-rich-card-carousel.php | 67 +++++++++++++++++++ messages/rcs/send-rich-card-standalone.php | 53 +++++++++++++++ ...suggested-action-create-calendar-event.php | 39 +++++++++++ messages/rcs/send-suggested-action-dial.php | 33 +++++++++ .../rcs/send-suggested-action-multiple.php | 41 ++++++++++++ .../rcs/send-suggested-action-open-url.php | 32 +++++++++ .../send-suggested-action-share-location.php | 33 +++++++++ .../send-suggested-action-view-location.php | 40 +++++++++++ messages/rcs/send-suggested-reply.php | 37 ++++++++++ 9 files changed, 375 insertions(+) create mode 100644 messages/rcs/send-rich-card-carousel.php create mode 100644 messages/rcs/send-rich-card-standalone.php create mode 100644 messages/rcs/send-suggested-action-create-calendar-event.php create mode 100644 messages/rcs/send-suggested-action-dial.php create mode 100644 messages/rcs/send-suggested-action-multiple.php create mode 100644 messages/rcs/send-suggested-action-open-url.php create mode 100644 messages/rcs/send-suggested-action-share-location.php create mode 100644 messages/rcs/send-suggested-action-view-location.php create mode 100644 messages/rcs/send-suggested-reply.php diff --git a/messages/rcs/send-rich-card-carousel.php b/messages/rcs/send-rich-card-carousel.php new file mode 100644 index 0000000..b47a09c --- /dev/null +++ b/messages/rcs/send-rich-card-carousel.php @@ -0,0 +1,67 @@ + [ + "richCard" => [ + "carouselCard" => [ + "cardWidth" => "MEDIUM", + "cardContents" => [ + [ + "title" => "Option 1: Photo", + "description" => "Do you prefer this photo?", + "suggestions" => [ + [ + "reply" => [ + "text" => "Option 1", + "postbackData" => "card_1" + ] + ] + ], + "media" => [ + "height" => "MEDIUM", + "contentInfo" => [ + "fileUrl" => "'\$IMAGE_URL'", + "forceRefresh" => "false" + ] + ] + ], + [ + "title" => "Option 2: Video", + "description" => "Or this video?", + "suggestions" => [ + [ + "reply" => [ + "text" => "Option 2", + "postbackData" => "card_2" + ] + ] + ], + "media" => [ + "height" => "MEDIUM", + "contentInfo" => [ + "fileUrl" => "'\$VIDEO_URL'", + "forceRefresh" => "false" + ] + ] + ] + ] + ] + ] + ] + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-rich-card-standalone.php b/messages/rcs/send-rich-card-standalone.php new file mode 100644 index 0000000..7140297 --- /dev/null +++ b/messages/rcs/send-rich-card-standalone.php @@ -0,0 +1,53 @@ + [ + "richCard" => [ + "standaloneCard" => [ + "thumbnailImageAlignment" => "RIGHT", + "cardOrientation" => "VERTICAL", + "cardContent" => [ + "title" => "Quick question", + "description" => "Do you like this picture?", + "media" => [ + "height" => "TALL", + "contentInfo" => [ + "fileUrl" => "'\$IMAGE_URL'", + "forceRefresh" => "false" + ] + ], + "suggestions" => [ + [ + "reply" => [ + "text" => "Yes", + "postbackData" => "suggestion_1" + ] + ], + [ + "reply" => [ + "text" => "I love it!", + "postbackData" => "suggestion_2" + ] + ] + ] + ] + ] + ] + ] + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-suggested-action-create-calendar-event.php b/messages/rcs/send-suggested-action-create-calendar-event.php new file mode 100644 index 0000000..ca307cc --- /dev/null +++ b/messages/rcs/send-suggested-action-create-calendar-event.php @@ -0,0 +1,39 @@ + [ + "text" => "Product Launch: Save the date!", + "suggestions" => [ + [ + "action" => [ + "text" => "Save to calendar", + "postbackData" => "postback_data_1234", + "fallbackUrl" => "https://www.google.com/calendar", + "createCalendarEventAction" => [ + "startTime" => "2024-06-28T19:00:00Z", + "endTime" => "2024-06-28T20:00:00Z", + "title" => "Vonage API Product Launch", + "description" => + "Event to demo Vonage\'s new and exciting API product", + ], + ], + ], + ], + ], + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-suggested-action-dial.php b/messages/rcs/send-suggested-action-dial.php new file mode 100644 index 0000000..6aaae6d --- /dev/null +++ b/messages/rcs/send-suggested-action-dial.php @@ -0,0 +1,33 @@ + [ + "text" => "Call us to claim your free gift!", + "suggestions" => [ + [ + "action" => [ + "text" => "Call now!", + "postbackData" => "postback_data_1234", + "fallbackUrl" => "https://www.example.com/contact/", + "dialAction" => ["phoneNumber" => "+447900000000"], + ], + ], + ], + ], + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-suggested-action-multiple.php b/messages/rcs/send-suggested-action-multiple.php new file mode 100644 index 0000000..d4ccff4 --- /dev/null +++ b/messages/rcs/send-suggested-action-multiple.php @@ -0,0 +1,41 @@ + [ + "text" => + "Need some help? Call us now or visit our website for more information.", + "suggestions" => [ + [ + "action" => [ + "text" => "Call us", + "postbackData" => "postback_data_1234", + "fallbackUrl" => "https://www.example.com/contact/", + "dialAction" => ["phoneNumber" => "+447900000000"], + ], + ], + [ + "action" => [ + "text" => "Visit site", + "postbackData" => "postback_data_1234", + "openUrlAction" => ["url" => "http://example.com/"], + ], + ], + ], + ], + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-suggested-action-open-url.php b/messages/rcs/send-suggested-action-open-url.php new file mode 100644 index 0000000..1d05abf --- /dev/null +++ b/messages/rcs/send-suggested-action-open-url.php @@ -0,0 +1,32 @@ + [ + "text" => "Check out our latest offers!", + "suggestions" => [ + [ + "action" => [ + "text" => "Open product page", + "postbackData" => "postback_data_1234", + "openUrlAction" => ["url" => "http://example.com/"], + ], + ], + ], + ], + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-suggested-action-share-location.php b/messages/rcs/send-suggested-action-share-location.php new file mode 100644 index 0000000..6e074c9 --- /dev/null +++ b/messages/rcs/send-suggested-action-share-location.php @@ -0,0 +1,33 @@ + [ + "text" => + "Your driver will come and meet you at your specified location.", + "suggestions" => [ + [ + "action" => [ + "text" => "Share a location", + "postbackData" => "postback_data_1234", + "shareLocationAction" => [], + ], + ], + ], + ], + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-suggested-action-view-location.php b/messages/rcs/send-suggested-action-view-location.php new file mode 100644 index 0000000..dc28708 --- /dev/null +++ b/messages/rcs/send-suggested-action-view-location.php @@ -0,0 +1,40 @@ + [ + "text" => "Drop by our office!", + "suggestions" => [ + [ + "action" => [ + "text" => "View map", + "postbackData" => "postback_data_1234", + "fallbackUrl" => + "https://www.google.com/maps/place/Vonage/@51.5230371,-0.0852492,15z", + "viewLocationAction" => [ + "latLong" => [ + "latitude" => "51.5230371", + "longitude" => "-0.0852492", + ], + "label" => "Vonage London Office", + ], + ], + ], + ], + ], + ] +); + +$client->messages()->send($rcsCard); diff --git a/messages/rcs/send-suggested-reply.php b/messages/rcs/send-suggested-reply.php new file mode 100644 index 0000000..ad03061 --- /dev/null +++ b/messages/rcs/send-suggested-reply.php @@ -0,0 +1,37 @@ + [ + "text" => "What do you think of Vonage APIs?", + "suggestions" => [ + [ + "reply" => [ + "text" => "They\'re great!", + "postbackData" => "suggestion_1", + ], + ], + [ + "reply" => [ + "text" => "They\'re awesome!", + "postbackData" => "suggestion_2", + ], + ], + ], + ], + ] +); + +$client->messages()->send($rcsCard); From fc3bc143ece49714a188b2d1b0884c07461c5dc5 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Wed, 16 Oct 2024 12:58:10 +0100 Subject: [PATCH 28/46] Added subaccount snippets --- subaccounts/create-subaccount.php | 13 +++++++++++++ subaccounts/get-balance-transfers.php | 12 ++++++++++++ subaccounts/get-credit-transfers.php | 12 ++++++++++++ subaccounts/get-subaccount.php | 9 +++++++++ subaccounts/get-subaccounts.php | 9 +++++++++ subaccounts/reactivate-subaccount.php | 13 +++++++++++++ subaccounts/suspend-subaccount.php | 13 +++++++++++++ subaccounts/transfer-balance.php | 16 ++++++++++++++++ subaccounts/transfer-credit.php | 15 +++++++++++++++ 9 files changed, 112 insertions(+) create mode 100644 subaccounts/create-subaccount.php create mode 100644 subaccounts/get-balance-transfers.php create mode 100644 subaccounts/get-credit-transfers.php create mode 100644 subaccounts/get-subaccount.php create mode 100644 subaccounts/get-subaccounts.php create mode 100644 subaccounts/reactivate-subaccount.php create mode 100644 subaccounts/suspend-subaccount.php create mode 100644 subaccounts/transfer-balance.php create mode 100644 subaccounts/transfer-credit.php diff --git a/subaccounts/create-subaccount.php b/subaccounts/create-subaccount.php new file mode 100644 index 0000000..0b9a989 --- /dev/null +++ b/subaccounts/create-subaccount.php @@ -0,0 +1,13 @@ +setName(NEW_SUBACCOUNT_NAME); +$account->setSecret(NEW_SUBACCOUNT_SECRET); + +$client->subaccount()->createSubaccount(VONAGE_API_KEY, $account); \ No newline at end of file diff --git a/subaccounts/get-balance-transfers.php b/subaccounts/get-balance-transfers.php new file mode 100644 index 0000000..3eb27af --- /dev/null +++ b/subaccounts/get-balance-transfers.php @@ -0,0 +1,12 @@ + START_DATE +]); + +$balanceTransfers = $client->subaccount()->getBalanceTransfers(VONAGE_API_KEY, $startDateFilter); \ No newline at end of file diff --git a/subaccounts/get-credit-transfers.php b/subaccounts/get-credit-transfers.php new file mode 100644 index 0000000..b183852 --- /dev/null +++ b/subaccounts/get-credit-transfers.php @@ -0,0 +1,12 @@ + START_DATE +]); + +$creditTransfers = $client->subaccount()->getCreditTransfers(VONAGE_API_KEY, $startDateFilter); \ No newline at end of file diff --git a/subaccounts/get-subaccount.php b/subaccounts/get-subaccount.php new file mode 100644 index 0000000..bd758bd --- /dev/null +++ b/subaccounts/get-subaccount.php @@ -0,0 +1,9 @@ +subaccount()->getSubaccount(VONAGE_API_KEY, SUBACCOUNT_KEY); \ No newline at end of file diff --git a/subaccounts/get-subaccounts.php b/subaccounts/get-subaccounts.php new file mode 100644 index 0000000..3ef744c --- /dev/null +++ b/subaccounts/get-subaccounts.php @@ -0,0 +1,9 @@ +subaccount()->getSubaccounts(VONAGE_API_KEY); \ No newline at end of file diff --git a/subaccounts/reactivate-subaccount.php b/subaccounts/reactivate-subaccount.php new file mode 100644 index 0000000..990d6c6 --- /dev/null +++ b/subaccounts/reactivate-subaccount.php @@ -0,0 +1,13 @@ + +setSuspended(false); + +$subaccount = $client->subaccount()->updateSubaccount(VONAGE_API_KEY, SUBACCOUNT_KEY, $account); \ No newline at end of file diff --git a/subaccounts/suspend-subaccount.php b/subaccounts/suspend-subaccount.php new file mode 100644 index 0000000..a16ad78 --- /dev/null +++ b/subaccounts/suspend-subaccount.php @@ -0,0 +1,13 @@ + +setSuspended(true); + +$subaccount = $client->subaccount()->updateSubaccount(VONAGE_API_KEY, SUBACCOUNT_KEY, $account); \ No newline at end of file diff --git a/subaccounts/transfer-balance.php b/subaccounts/transfer-balance.php new file mode 100644 index 0000000..ef49cde --- /dev/null +++ b/subaccounts/transfer-balance.php @@ -0,0 +1,16 @@ + +setFrom(VONAGE_API_KEY) + ->setTo(SUBACCOUNT_KEY) + ->setAmount(250); + +$subaccount = $client->subaccount()->makeBalanceTransfer($transferRequest); \ No newline at end of file diff --git a/subaccounts/transfer-credit.php b/subaccounts/transfer-credit.php new file mode 100644 index 0000000..dd6c5eb --- /dev/null +++ b/subaccounts/transfer-credit.php @@ -0,0 +1,15 @@ +setFrom(VONAGE_API_KEY) + ->setTo(SUBACCOUNT_KEY) + ->setAmount(250); + +$subaccount = $client->subaccount()->makeBalanceTransfer($transferRequest); \ No newline at end of file From ff2c31900307e3c8d322950f801b55d0e6cb4ac4 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Fri, 25 Oct 2024 13:48:58 +0100 Subject: [PATCH 29/46] Bump check code --- verify2/check-verification-code.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify2/check-verification-code.php b/verify2/check-verification-code.php index 3c534ab..308c3ae 100644 --- a/verify2/check-verification-code.php +++ b/verify2/check-verification-code.php @@ -8,7 +8,7 @@ ); try { - $client->verify2()->check(CODE); + $client->verify2()->check(REQUEST_ID, CODE); } catch (\Exception $e) { var_dump($e->getMessage()); } From 8725d6a9eb681fdd3c648a2cc8492068eb5f09e5 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Mon, 11 Nov 2024 15:41:53 +0000 Subject: [PATCH 30/46] Fixes and additions --- messages/messenger/send-audio.php | 4 +- messages/messenger/send-file.php | 4 +- messages/messenger/send-image.php | 4 +- messages/messenger/send-text.php | 4 +- messages/messenger/send-video.php | 4 +- messages/viber/send-file.php | 18 ++++++ messages/viber/send-image.php | 4 +- messages/viber/send-text.php | 4 +- messages/viber/send-video.php | 18 ++++++ messages/whatsapp/mark-as-read.php | 13 +++++ messages/whatsapp/send-audio.php | 4 +- .../whatsapp/send-authentication-template.php | 58 +++++++++++++++++++ messages/whatsapp/send-button-link.php | 4 +- messages/whatsapp/send-button-quick-reply.php | 4 +- messages/whatsapp/send-contact.php | 4 +- messages/whatsapp/send-file.php | 4 +- messages/whatsapp/send-image.php | 4 +- messages/whatsapp/send-location.php | 4 +- messages/whatsapp/send-media-mtm.php | 4 +- messages/whatsapp/send-mtm.php | 4 +- messages/whatsapp/send-multi-product.php | 53 +++++++++++++++++ messages/whatsapp/send-reaction.php | 32 ++++++++++ messages/whatsapp/send-single-product.php | 41 +++++++++++++ messages/whatsapp/send-sticker-id.php | 29 ++++++++++ messages/whatsapp/send-sticker-url.php | 29 ++++++++++ messages/whatsapp/send-text.php | 4 +- messages/whatsapp/send-unreaction.php | 31 ++++++++++ messages/whatsapp/send-video.php | 4 +- sms/send-sms.php | 2 +- 29 files changed, 377 insertions(+), 19 deletions(-) create mode 100644 messages/viber/send-file.php create mode 100644 messages/viber/send-video.php create mode 100644 messages/whatsapp/mark-as-read.php create mode 100644 messages/whatsapp/send-authentication-template.php create mode 100644 messages/whatsapp/send-multi-product.php create mode 100644 messages/whatsapp/send-reaction.php create mode 100644 messages/whatsapp/send-single-product.php create mode 100644 messages/whatsapp/send-sticker-id.php create mode 100644 messages/whatsapp/send-sticker-url.php create mode 100644 messages/whatsapp/send-unreaction.php diff --git a/messages/messenger/send-audio.php b/messages/messenger/send-audio.php index d259be6..3c1b715 100644 --- a/messages/messenger/send-audio.php +++ b/messages/messenger/send-audio.php @@ -14,8 +14,10 @@ 'This is an audio file' ); -$message = new \Vonage\Messages\MessageType\Messenger\MessengerAudio( +$message = new \Vonage\Messages\Channel\Messenger\MessengerAudio( TO_NUMBER, FROM_NUMBER, $audioObject ); + +$client->messages()->send($message); \ No newline at end of file diff --git a/messages/messenger/send-file.php b/messages/messenger/send-file.php index bc5cb81..b03241b 100644 --- a/messages/messenger/send-file.php +++ b/messages/messenger/send-file.php @@ -13,8 +13,10 @@ 'https://example.com/file.pdf', ); -$message = new \Vonage\Messages\MessageType\Messenger\MessengerFile( +$message = new \Vonage\Messages\Channel\Messenger\MessengerFile( TO_NUMBER, FROM_NUMBER, $fileObject ); + +$client->messages()->send($message); \ No newline at end of file diff --git a/messages/messenger/send-image.php b/messages/messenger/send-image.php index e65a9a7..83b425b 100644 --- a/messages/messenger/send-image.php +++ b/messages/messenger/send-image.php @@ -14,8 +14,10 @@ 'This is an image' ); -$message = new \Vonage\Messages\MessageType\Messenger\MessengerImage( +$message = new \Vonage\Messages\Channel\Messenger\MessengerImage( TO_NUMBER, FROM_NUMBER, $imageObject ); + +$client->messages()->send($message); \ No newline at end of file diff --git a/messages/messenger/send-text.php b/messages/messenger/send-text.php index e49eecd..cde1edf 100644 --- a/messages/messenger/send-text.php +++ b/messages/messenger/send-text.php @@ -9,8 +9,10 @@ $client = new \Vonage\Client($keypair); -$message = new \Vonage\Messages\MessageType\Messenger\MessengerText( +$message = new \Vonage\Messages\Channel\Messenger\MessengerText( TO_NUMBER, FROM_NUMBER, 'This is a text message sent using the Vonage PHP SDK' ); + +$client->messages()->send($message); \ No newline at end of file diff --git a/messages/messenger/send-video.php b/messages/messenger/send-video.php index c637796..5b1678c 100644 --- a/messages/messenger/send-video.php +++ b/messages/messenger/send-video.php @@ -14,8 +14,10 @@ 'This is an video file' ); -$message = new \Vonage\Messages\MessageType\Messenger\MessengerVideo( +$message = new \Vonage\Messages\Channel\Messenger\MessengerVideo( TO_NUMBER, FROM_NUMBER, $videoObject ); + +$client->messages()->send($message); \ No newline at end of file diff --git a/messages/viber/send-file.php b/messages/viber/send-file.php new file mode 100644 index 0000000..1a45f9d --- /dev/null +++ b/messages/viber/send-file.php @@ -0,0 +1,18 @@ +messages()->send($viber); \ No newline at end of file diff --git a/messages/viber/send-image.php b/messages/viber/send-image.php index 47bffdb..2920259 100644 --- a/messages/viber/send-image.php +++ b/messages/viber/send-image.php @@ -14,8 +14,10 @@ 'This is an image' ); -$viber = new \Vonage\Messages\MessageType\Viber\ViberImage( +$viber = new \Vonage\Messages\Channel\Viber\ViberImage( TO_NUMBER, FROM_NUMBER, $imageObject ); + +$client->messages()->send($viber); \ No newline at end of file diff --git a/messages/viber/send-text.php b/messages/viber/send-text.php index 411f499..d09f864 100644 --- a/messages/viber/send-text.php +++ b/messages/viber/send-text.php @@ -9,8 +9,10 @@ $client = new \Vonage\Client($keypair); -$viber = new \Vonage\Messages\MessageType\Viber\ViberText( +$viber = new \Vonage\Messages\Channel\Viber\ViberText( TO_NUMBER, FROM_NUMBER, 'This is a text message sent using the Vonage PHP SDK' ); + +$client->messages()->send($viber); \ No newline at end of file diff --git a/messages/viber/send-video.php b/messages/viber/send-video.php new file mode 100644 index 0000000..62bf20f --- /dev/null +++ b/messages/viber/send-video.php @@ -0,0 +1,18 @@ +messages()->send($viber); \ No newline at end of file diff --git a/messages/whatsapp/mark-as-read.php b/messages/whatsapp/mark-as-read.php new file mode 100644 index 0000000..c55e77a --- /dev/null +++ b/messages/whatsapp/mark-as-read.php @@ -0,0 +1,13 @@ +messages()->getAPIResource()->setBaseUrl('https://api-eu.nexmo.com/v1'); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-audio.php b/messages/whatsapp/send-audio.php index 267b333..3143b2a 100644 --- a/messages/whatsapp/send-audio.php +++ b/messages/whatsapp/send-audio.php @@ -14,8 +14,10 @@ 'This is an audio file' ); -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppAudio( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppAudio( TO_NUMBER, FROM_NUMBER, $audioObject ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-authentication-template.php b/messages/whatsapp/send-authentication-template.php new file mode 100644 index 0000000..beac0a5 --- /dev/null +++ b/messages/whatsapp/send-authentication-template.php @@ -0,0 +1,58 @@ + TO_NUMBER, + "from" => WHATSAPP_NUMBER, + "channel" => "whatsapp", + "message_type" => "custom", + "custom" => [ + "type" => "template", + "template" => [ + "name" => WHATSAPP_AUTH_TEMPLATE_NAME, + "language" => [ + "policy" => "deterministic", + "code" => "en" + ], + "components" => [ + [ + "type" => "body", + "parameters" => [ + [ + "type" => "text", + "text" => '$OTP' + ] + ] + ], + [ + "type" => "button", + "sub_type" => "url", + "index" => "0", + "parameters" => [ + [ + "type" => "text", + "text" => '$OTP' + ] + ] + ] + ] + ] + ] +]; + + +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( + TO_NUMBER, + FROM_NUMBER, + $custom +); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-button-link.php b/messages/whatsapp/send-button-link.php index c7cb81b..59402ad 100644 --- a/messages/whatsapp/send-button-link.php +++ b/messages/whatsapp/send-button-link.php @@ -46,8 +46,10 @@ ], ]; -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppCustom( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( TO_NUMBER, FROM_NUMBER, $custom ); + +$client->messages()->send($whatsApp); diff --git a/messages/whatsapp/send-button-quick-reply.php b/messages/whatsapp/send-button-quick-reply.php index c82b9c5..440bc9c 100644 --- a/messages/whatsapp/send-button-quick-reply.php +++ b/messages/whatsapp/send-button-quick-reply.php @@ -51,8 +51,10 @@ ], ]; -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppCustom( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( TO_NUMBER, FROM_NUMBER, $custom ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-contact.php b/messages/whatsapp/send-contact.php index c6de6af..ae3be75 100644 --- a/messages/whatsapp/send-contact.php +++ b/messages/whatsapp/send-contact.php @@ -61,8 +61,10 @@ ], ]; -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppCustom( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( TO_NUMBER, FROM_NUMBER, $custom ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-file.php b/messages/whatsapp/send-file.php index e4f1490..3f5cdd1 100644 --- a/messages/whatsapp/send-file.php +++ b/messages/whatsapp/send-file.php @@ -14,8 +14,10 @@ 'This is a whatsapp file' ); -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppFile( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppFile( TO_NUMBER, FROM_NUMBER, $fileObject ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-image.php b/messages/whatsapp/send-image.php index f18c7ad..343beb3 100644 --- a/messages/whatsapp/send-image.php +++ b/messages/whatsapp/send-image.php @@ -14,8 +14,10 @@ 'This is a whatsapp image' ); -$whatsApp = new \Vonage\Messages\MessageType\Messenger\MessengerImage( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppImage( TO_NUMBER, FROM_NUMBER, $imageObject ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-location.php b/messages/whatsapp/send-location.php index 5a8c45a..d456c36 100644 --- a/messages/whatsapp/send-location.php +++ b/messages/whatsapp/send-location.php @@ -19,8 +19,10 @@ ], ]; -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppCustom( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( TO_NUMBER, FROM_NUMBER, $custom ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-media-mtm.php b/messages/whatsapp/send-media-mtm.php index 5441064..6c8817d 100644 --- a/messages/whatsapp/send-media-mtm.php +++ b/messages/whatsapp/send-media-mtm.php @@ -37,8 +37,10 @@ ], ]; -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppCustom( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( TO_NUMBER, FROM_NUMBER, $custom ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-mtm.php b/messages/whatsapp/send-mtm.php index 2c364c6..e922791 100644 --- a/messages/whatsapp/send-mtm.php +++ b/messages/whatsapp/send-mtm.php @@ -18,8 +18,10 @@ ], ]; -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppCustom( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( TO_NUMBER, FROM_NUMBER, $custom ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-multi-product.php b/messages/whatsapp/send-multi-product.php new file mode 100644 index 0000000..beae509 --- /dev/null +++ b/messages/whatsapp/send-multi-product.php @@ -0,0 +1,53 @@ + "interactive", + "interactive" => [ + "type" => "product_list", + "header" => [ + "type" => "text", + "text" => "Our top products" + ], + "body" => [ + "text" => "Check out these great products" + ], + "footer" => [ + "text" => "Sale now on!" + ], + "action" => [ + "catalog_id" => CATALOG_ID, + "sections" => [ + [ + "title" => "Cool products", + "product_items" => [ + ["product_retailer_id" => PRODUCT_ID], + ["product_retailer_id" => PRODUCT_ID] + ] + ], + [ + "title" => "Awesome products", + "product_items" => [ + ["product_retailer_id" => PRODUCT_ID] + ] + ] + ] + ] + ] +]; + +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( + TO_NUMBER, + FROM_NUMBER, + $custom +); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-reaction.php b/messages/whatsapp/send-reaction.php new file mode 100644 index 0000000..1ac5f4b --- /dev/null +++ b/messages/whatsapp/send-reaction.php @@ -0,0 +1,32 @@ + "reaction", + "reaction" => [ + "action" => "react", + "emoji" => EMOJI + ], + "context" => [ + "message_uuid" => MESSAGE_UUID + ], + "to" => TO_NUMBER, + "from" => WHATSAPP_NUMBER, + "channel" => "whatsapp" +]; + +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( + TO_NUMBER, + FROM_NUMBER, + $custom +); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-single-product.php b/messages/whatsapp/send-single-product.php new file mode 100644 index 0000000..42d666a --- /dev/null +++ b/messages/whatsapp/send-single-product.php @@ -0,0 +1,41 @@ + TO_NUMBER, + "from" => WHATSAPP_NUMBER, + "channel" => "whatsapp", + "message_type" => "custom", + "custom" => [ + "type" => "interactive", + "interactive" => [ + "type" => "product", + "body" => [ + "text" => "Check out this cool product" + ], + "footer" => [ + "text" => "Sale now on!" + ], + "action" => [ + "catalog_id" => CATALOG_ID, + "product_retailer_id" => PRODUCT_ID + ] + ] + ] +]; + +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( + TO_NUMBER, + FROM_NUMBER, + $custom +); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-sticker-id.php b/messages/whatsapp/send-sticker-id.php new file mode 100644 index 0000000..af91e2a --- /dev/null +++ b/messages/whatsapp/send-sticker-id.php @@ -0,0 +1,29 @@ + "sticker", + "sticker" => [ + "id" => STICKER_ID + ], + "to" => TO_NUMBER, + "from" => WHATSAPP_NUMBER, + "channel" => "whatsapp" +]; + + +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( + TO_NUMBER, + FROM_NUMBER, + $custom +); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-sticker-url.php b/messages/whatsapp/send-sticker-url.php new file mode 100644 index 0000000..b99fe5b --- /dev/null +++ b/messages/whatsapp/send-sticker-url.php @@ -0,0 +1,29 @@ + "sticker", + "sticker" => [ + "url" => STICKER_URL + ], + "to" => TO_NUMBER, + "from" => WHATSAPP_NUMBER, + "channel" => "whatsapp" +]; + + +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( + TO_NUMBER, + FROM_NUMBER, + $custom +); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-text.php b/messages/whatsapp/send-text.php index 8861a77..3d536ea 100644 --- a/messages/whatsapp/send-text.php +++ b/messages/whatsapp/send-text.php @@ -9,8 +9,10 @@ $client = new \Vonage\Client($keypair); -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppText( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppText( TO_NUMBER, FROM_NUMBER, 'This is a text message sent using the Vonage PHP SDK' ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-unreaction.php b/messages/whatsapp/send-unreaction.php new file mode 100644 index 0000000..b145b13 --- /dev/null +++ b/messages/whatsapp/send-unreaction.php @@ -0,0 +1,31 @@ + "reaction", + "reaction" => [ + "action" => "unreact" + ], + "context" => [ + "message_uuid" => MESSAGE_UUID + ], + "to" => TO_NUMBER, + "from" => WHATSAPP_NUMBER, + "channel" => "whatsapp" +]; + +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppCustom( + TO_NUMBER, + FROM_NUMBER, + $custom +); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/messages/whatsapp/send-video.php b/messages/whatsapp/send-video.php index 039d80c..5dc5c4c 100644 --- a/messages/whatsapp/send-video.php +++ b/messages/whatsapp/send-video.php @@ -14,8 +14,10 @@ 'This is an video file' ); -$whatsApp = new \Vonage\Messages\MessageType\WhatsApp\WhatsAppVideo( +$whatsApp = new \Vonage\Messages\Channel\WhatsApp\WhatsAppVideo( TO_NUMBER, FROM_NUMBER, $videoObject ); + +$client->messages()->send($whatsApp); \ No newline at end of file diff --git a/sms/send-sms.php b/sms/send-sms.php index 3420976..af77d53 100644 --- a/sms/send-sms.php +++ b/sms/send-sms.php @@ -7,7 +7,7 @@ $client = new \Vonage\Client($basic); $response = $client->sms()->send( - new \Vonage\SMS\Message\SMS(TO_NUMBER, BRAND_NAME, 'A text message sent using the Nexmo SMS API') + new \Vonage\SMS\Message\SMS(TO_NUMBER, BRAND_NAME, 'A text message sent using the Vonage SMS API') ); $message = $response->current(); From b46cc80e1f44162324070fa6d07a152415d0b73d Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Wed, 13 Nov 2024 11:29:21 +0000 Subject: [PATCH 31/46] Added missing inbound hydration --- composer.json | 3 ++- messages/inbound-message.php | 15 +++++++++++++++ messages/message-status.php | 12 ++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 messages/inbound-message.php create mode 100644 messages/message-status.php diff --git a/composer.json b/composer.json index 0188662..63d7b38 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,8 @@ "require": { "vonage/client": "^4.0", "vlucas/phpdotenv": "^2.5", - "lcobucci/jwt": "^4.0" + "lcobucci/jwt": "^4.0", + "ext-json": "*" } , "require-dev": { diff --git a/messages/inbound-message.php b/messages/inbound-message.php new file mode 100644 index 0000000..f425253 --- /dev/null +++ b/messages/inbound-message.php @@ -0,0 +1,15 @@ + Date: Thu, 14 Nov 2024 15:29:56 +0000 Subject: [PATCH 32/46] missing client call for MMS --- messages/mms/send-mms.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/messages/mms/send-mms.php b/messages/mms/send-mms.php index 4e3e015..7d5ba8b 100644 --- a/messages/mms/send-mms.php +++ b/messages/mms/send-mms.php @@ -19,3 +19,5 @@ FROM_NUMBER, $image ); + +$client->messages()->send($mms); \ No newline at end of file From a93d3492dc614f97f79851bcb7499c84d8de27fb Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Wed, 20 Nov 2024 15:27:40 +0000 Subject: [PATCH 33/46] added conversations snippets --- .../conversation/create-conversation.php | 17 +++++++++++++ .../conversation/delete-conversation.php | 15 +++++++++++ .../conversation/get-conversation.php | 15 +++++++++++ .../conversation/list-conversations.php | 15 +++++++++++ .../conversation/update-conversations.php | 21 ++++++++++++++++ conversation/event/create-custom-event.php | 25 +++++++++++++++++++ conversation/event/create-event.php | 22 ++++++++++++++++ conversation/event/delete-event.php | 16 ++++++++++++ conversation/event/get-event.php | 16 ++++++++++++ conversation/event/list-events.php | 16 ++++++++++++ conversation/member/create-member.php | 25 +++++++++++++++++++ conversation/member/delete-member.php | 16 ++++++++++++ conversation/member/get-member.php | 16 ++++++++++++ conversation/member/list-members.php | 16 ++++++++++++ conversation/member/update-member.php | 22 ++++++++++++++++ conversation/user/list-user-conversations.php | 16 ++++++++++++ 16 files changed, 289 insertions(+) create mode 100644 conversation/conversation/create-conversation.php create mode 100644 conversation/conversation/delete-conversation.php create mode 100644 conversation/conversation/get-conversation.php create mode 100644 conversation/conversation/list-conversations.php create mode 100644 conversation/conversation/update-conversations.php create mode 100644 conversation/event/create-custom-event.php create mode 100644 conversation/event/create-event.php create mode 100644 conversation/event/delete-event.php create mode 100644 conversation/event/get-event.php create mode 100644 conversation/event/list-events.php create mode 100644 conversation/member/create-member.php create mode 100644 conversation/member/delete-member.php create mode 100644 conversation/member/get-member.php create mode 100644 conversation/member/list-members.php create mode 100644 conversation/member/update-member.php create mode 100644 conversation/user/list-user-conversations.php diff --git a/conversation/conversation/create-conversation.php b/conversation/conversation/create-conversation.php new file mode 100644 index 0000000..a578628 --- /dev/null +++ b/conversation/conversation/create-conversation.php @@ -0,0 +1,17 @@ +conversation()->createConversation($createConversationRequest); \ No newline at end of file diff --git a/conversation/conversation/delete-conversation.php b/conversation/conversation/delete-conversation.php new file mode 100644 index 0000000..b07f57e --- /dev/null +++ b/conversation/conversation/delete-conversation.php @@ -0,0 +1,15 @@ +conversation()->deleteConversationById(CONVERSATION_ID); \ No newline at end of file diff --git a/conversation/conversation/get-conversation.php b/conversation/conversation/get-conversation.php new file mode 100644 index 0000000..eaa1b93 --- /dev/null +++ b/conversation/conversation/get-conversation.php @@ -0,0 +1,15 @@ +conversation()->getConversationById(CONVERSATION_ID); \ No newline at end of file diff --git a/conversation/conversation/list-conversations.php b/conversation/conversation/list-conversations.php new file mode 100644 index 0000000..f8b50c2 --- /dev/null +++ b/conversation/conversation/list-conversations.php @@ -0,0 +1,15 @@ +conversation()->listConversations(); \ No newline at end of file diff --git a/conversation/conversation/update-conversations.php b/conversation/conversation/update-conversations.php new file mode 100644 index 0000000..467ac15 --- /dev/null +++ b/conversation/conversation/update-conversations.php @@ -0,0 +1,21 @@ + CONV_NEW_NAME, + 'display_name' => CONV_NEW_NAME +]); + +$client->conversation()->updateConversationById(CONVERSATION_ID, $updateConversationRequest); \ No newline at end of file diff --git a/conversation/event/create-custom-event.php b/conversation/event/create-custom-event.php new file mode 100644 index 0000000..4bc6439 --- /dev/null +++ b/conversation/event/create-custom-event.php @@ -0,0 +1,25 @@ + 'data' + ] +); + +$client->conversation()->createEvent($eventRequest); \ No newline at end of file diff --git a/conversation/event/create-event.php b/conversation/event/create-event.php new file mode 100644 index 0000000..3b017cf --- /dev/null +++ b/conversation/event/create-event.php @@ -0,0 +1,22 @@ +conversation()->createEvent($eventRequest); \ No newline at end of file diff --git a/conversation/event/delete-event.php b/conversation/event/delete-event.php new file mode 100644 index 0000000..79277f7 --- /dev/null +++ b/conversation/event/delete-event.php @@ -0,0 +1,16 @@ +conversation()->deleteEventById(EVENT_ID, CONVERSATION_ID); diff --git a/conversation/event/get-event.php b/conversation/event/get-event.php new file mode 100644 index 0000000..1dde974 --- /dev/null +++ b/conversation/event/get-event.php @@ -0,0 +1,16 @@ +conversation()->getEventById(EVENT_ID, CONVERSATION_ID); diff --git a/conversation/event/list-events.php b/conversation/event/list-events.php new file mode 100644 index 0000000..6bc5538 --- /dev/null +++ b/conversation/event/list-events.php @@ -0,0 +1,16 @@ +conversation()->delete(CONVERSATION_ID); diff --git a/conversation/member/create-member.php b/conversation/member/create-member.php new file mode 100644 index 0000000..0a62b0d --- /dev/null +++ b/conversation/member/create-member.php @@ -0,0 +1,25 @@ +conversation()->createMember($createMemberRequest, CONVERSATION_ID); diff --git a/conversation/member/delete-member.php b/conversation/member/delete-member.php new file mode 100644 index 0000000..9ebfc0f --- /dev/null +++ b/conversation/member/delete-member.php @@ -0,0 +1,16 @@ +conversation()->deleteMember(MEMBER_ID, CONVERSATION_ID); \ No newline at end of file diff --git a/conversation/member/get-member.php b/conversation/member/get-member.php new file mode 100644 index 0000000..45ba703 --- /dev/null +++ b/conversation/member/get-member.php @@ -0,0 +1,16 @@ +conversation()->getMemberByConversationId(MEMBER_ID, CONVERSATION_ID); \ No newline at end of file diff --git a/conversation/member/list-members.php b/conversation/member/list-members.php new file mode 100644 index 0000000..1118932 --- /dev/null +++ b/conversation/member/list-members.php @@ -0,0 +1,16 @@ +conversation()->listMembersByConversationId(CONVERSATION_ID); \ No newline at end of file diff --git a/conversation/member/update-member.php b/conversation/member/update-member.php new file mode 100644 index 0000000..c7bee96 --- /dev/null +++ b/conversation/member/update-member.php @@ -0,0 +1,22 @@ +conversation()->updateMember($updateMemberRequest); \ No newline at end of file diff --git a/conversation/user/list-user-conversations.php b/conversation/user/list-user-conversations.php new file mode 100644 index 0000000..b624a12 --- /dev/null +++ b/conversation/user/list-user-conversations.php @@ -0,0 +1,16 @@ +conversation()->listUserConversationsByUserId(USER_ID); \ No newline at end of file From 8b904d3f1d328b0bde4d75804a305ee6724c7835 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Tue, 10 Dec 2024 11:52:27 +0000 Subject: [PATCH 34/46] fix balance transfer object --- subaccounts/transfer-credit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subaccounts/transfer-credit.php b/subaccounts/transfer-credit.php index dd6c5eb..ffa7507 100644 --- a/subaccounts/transfer-credit.php +++ b/subaccounts/transfer-credit.php @@ -6,7 +6,7 @@ $basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET); $client = new \Vonage\Client($basic); -$transferRequest = new \Vonage\Subaccount\Request\TransferCreditRequest(VONAGE_API_KEY); +$transferRequest = new \Vonage\Subaccount\Request\TransferBalanceRequest(VONAGE_API_KEY); $transferRequest ->setFrom(VONAGE_API_KEY) ->setTo(SUBACCOUNT_KEY) From 065153771ccd71b9cd0a37775a818d6c85081121 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Wed, 8 Jan 2025 10:07:44 +0000 Subject: [PATCH 35/46] fix download a recording snippet --- voice/download-a-recording/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voice/download-a-recording/index.php b/voice/download-a-recording/index.php index f685f0d..b04d487 100644 --- a/voice/download-a-recording/index.php +++ b/voice/download-a-recording/index.php @@ -7,4 +7,4 @@ $recordingUrl = 'https://api.nexmo.com/v1/files/'.VONAGE_RECORDING_ID; $data = $client->voice()->getRecording($recordingUrl); -file_put_contents(VONAGE_RECORDING_ID .'.mp3', $data->getBody()); +file_put_contents(VONAGE_RECORDING_ID .'.mp3', $data->getContents()); From 40d64990cb25622e80c6ceaae407016334abf2c2 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Wed, 5 Feb 2025 10:53:55 +0000 Subject: [PATCH 36/46] Add GNP snippets --- .../number-verification/verify-phone-number.php | 14 ++++++++++++++ network-apis/sim-swap/check-sim-swap-date.php | 14 ++++++++++++++ network-apis/sim-swap/check-sim-swap.php | 14 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 network-apis/number-verification/verify-phone-number.php create mode 100644 network-apis/sim-swap/check-sim-swap-date.php create mode 100644 network-apis/sim-swap/check-sim-swap.php diff --git a/network-apis/number-verification/verify-phone-number.php b/network-apis/number-verification/verify-phone-number.php new file mode 100644 index 0000000..c6bebeb --- /dev/null +++ b/network-apis/number-verification/verify-phone-number.php @@ -0,0 +1,14 @@ +numberVerification()->verifyNumber(PHONE_NUMBER); \ No newline at end of file diff --git a/network-apis/sim-swap/check-sim-swap-date.php b/network-apis/sim-swap/check-sim-swap-date.php new file mode 100644 index 0000000..e82a991 --- /dev/null +++ b/network-apis/sim-swap/check-sim-swap-date.php @@ -0,0 +1,14 @@ +simswap()->checkSimSwapDate(PHONE_NUMBER); \ No newline at end of file diff --git a/network-apis/sim-swap/check-sim-swap.php b/network-apis/sim-swap/check-sim-swap.php new file mode 100644 index 0000000..a6b2777 --- /dev/null +++ b/network-apis/sim-swap/check-sim-swap.php @@ -0,0 +1,14 @@ +simswap()->checkSimSwap(PHONE_NUMBER); \ No newline at end of file From ab4febace81131d181fae78f301e52a88ea42f14 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Wed, 5 Feb 2025 11:09:13 +0000 Subject: [PATCH 37/46] add application user snippets --- conversation/user/create-user.php | 21 +++++++++++++++++++ conversation/user/delete-user.php | 13 ++++++++++++ conversation/user/get-user.php | 13 ++++++++++++ conversation/user/list-user-conversations.php | 3 --- conversation/user/update-user.php | 17 +++++++++++++++ 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 conversation/user/create-user.php create mode 100644 conversation/user/delete-user.php create mode 100644 conversation/user/get-user.php create mode 100644 conversation/user/update-user.php diff --git a/conversation/user/create-user.php b/conversation/user/create-user.php new file mode 100644 index 0000000..5797f32 --- /dev/null +++ b/conversation/user/create-user.php @@ -0,0 +1,21 @@ + USER_NAME, + 'displayName' => USER_DISPLAY_NAME +]; + +$user = new \Vonage\Users\User(); +$user->fromArray($userData); + +$client->users()->createUser($user); \ No newline at end of file diff --git a/conversation/user/delete-user.php b/conversation/user/delete-user.php new file mode 100644 index 0000000..c35e5b4 --- /dev/null +++ b/conversation/user/delete-user.php @@ -0,0 +1,13 @@ +users()->deleteUser(USER_ID); \ No newline at end of file diff --git a/conversation/user/get-user.php b/conversation/user/get-user.php new file mode 100644 index 0000000..0cee847 --- /dev/null +++ b/conversation/user/get-user.php @@ -0,0 +1,13 @@ +users()->getUser(USER_ID); \ No newline at end of file diff --git a/conversation/user/list-user-conversations.php b/conversation/user/list-user-conversations.php index b624a12..8bd6d69 100644 --- a/conversation/user/list-user-conversations.php +++ b/conversation/user/list-user-conversations.php @@ -1,8 +1,5 @@ users()->getUser(USER_ID); +$user->setDisplayName(USER_NEW_DISPLAY_NAME); +$user->setName(USER_NEW_NAME); + +$client->users()->updateUser($user); \ No newline at end of file From e2e0a30cf9bdc7cd0161089900c947012fc16460 Mon Sep 17 00:00:00 2001 From: Jim Seconde Date: Thu, 6 Feb 2025 09:37:49 +0000 Subject: [PATCH 38/46] add list users --- conversation/user/list-users.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 conversation/user/list-users.php diff --git a/conversation/user/list-users.php b/conversation/user/list-users.php new file mode 100644 index 0000000..4522251 --- /dev/null +++ b/conversation/user/list-users.php @@ -0,0 +1,13 @@ +users()->listUsers(); \ No newline at end of file From f16a9f0e77b8e6109647f0ec4e450b5eb83c3d4d Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Thu, 13 Mar 2025 16:38:36 -0400 Subject: [PATCH 39/46] feat: added sms basic auth along with container --- sms/send-sms-basic.php | 19 +++++++++++++++++++ sms/send-sms.php | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 sms/send-sms-basic.php diff --git a/sms/send-sms-basic.php b/sms/send-sms-basic.php new file mode 100644 index 0000000..af77d53 --- /dev/null +++ b/sms/send-sms-basic.php @@ -0,0 +1,19 @@ +sms()->send( + new \Vonage\SMS\Message\SMS(TO_NUMBER, BRAND_NAME, 'A text message sent using the Vonage SMS API') +); + +$message = $response->current(); + +if ($message->getStatus() == 0) { + echo "The message was sent successfully\n"; +} else { + echo "The message failed with status: " . $message->getStatus() . "\n"; +} diff --git a/sms/send-sms.php b/sms/send-sms.php index af77d53..974fd9a 100644 --- a/sms/send-sms.php +++ b/sms/send-sms.php @@ -3,8 +3,8 @@ require_once __DIR__ . '/../config.php'; require_once __DIR__ . '/../vendor/autoload.php'; -$basic = new \Vonage\Client\Credentials\Basic(VONAGE_API_KEY, VONAGE_API_SECRET); -$client = new \Vonage\Client($basic); +$container = new \Vonage\Client\Credentials\Container(VONAGE_APPLICATION_ID, VONAGE_PRIVATE_KEY); +$client = new \Vonage\Client($container); $response = $client->sms()->send( new \Vonage\SMS\Message\SMS(TO_NUMBER, BRAND_NAME, 'A text message sent using the Vonage SMS API') From bbbb16af81a3a58bcf7a480862b3b960a9f5e7e0 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Fri, 14 Mar 2025 09:11:39 -0400 Subject: [PATCH 40/46] refactor: removed .idea --- .idea/.gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml From 21e4fa13c22b96bd4b05688bd81529e00abf4d9f Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Fri, 14 Mar 2025 09:52:28 -0400 Subject: [PATCH 41/46] refactor: updated credentials --- sms/send-sms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sms/send-sms.php b/sms/send-sms.php index 974fd9a..14733fb 100644 --- a/sms/send-sms.php +++ b/sms/send-sms.php @@ -3,8 +3,8 @@ require_once __DIR__ . '/../config.php'; require_once __DIR__ . '/../vendor/autoload.php'; -$container = new \Vonage\Client\Credentials\Container(VONAGE_APPLICATION_ID, VONAGE_PRIVATE_KEY); -$client = new \Vonage\Client($container); +$keypair = new \Vonage\Client\Credentials\Keypair(VONAGE_PRIVATE_KEY, VONAGE_APPLICATION_ID); +$client = new \Vonage\Client($keypair); $response = $client->sms()->send( new \Vonage\SMS\Message\SMS(TO_NUMBER, BRAND_NAME, 'A text message sent using the Vonage SMS API') From fc6b22b0fd7cb88a8bc7c8de91ffb88565486b22 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Fri, 14 Mar 2025 11:21:43 -0400 Subject: [PATCH 42/46] refactor: added missing mms snippets --- messages/mms/send-mms-audio.php | 22 ++++++++++++++++++++++ messages/mms/send-mms-vcard.php | 22 ++++++++++++++++++++++ messages/mms/send-mms-video.php | 22 ++++++++++++++++++++++ messages/mms/send-mms.php | 4 ++-- 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 messages/mms/send-mms-audio.php create mode 100644 messages/mms/send-mms-vcard.php create mode 100644 messages/mms/send-mms-video.php diff --git a/messages/mms/send-mms-audio.php b/messages/mms/send-mms-audio.php new file mode 100644 index 0000000..c9c7f88 --- /dev/null +++ b/messages/mms/send-mms-audio.php @@ -0,0 +1,22 @@ +messages()->send($mms); diff --git a/messages/mms/send-mms-vcard.php b/messages/mms/send-mms-vcard.php new file mode 100644 index 0000000..6ad133c --- /dev/null +++ b/messages/mms/send-mms-vcard.php @@ -0,0 +1,22 @@ +messages()->send($mms); diff --git a/messages/mms/send-mms-video.php b/messages/mms/send-mms-video.php new file mode 100644 index 0000000..cec011c --- /dev/null +++ b/messages/mms/send-mms-video.php @@ -0,0 +1,22 @@ +messages()->send($mms); diff --git a/messages/mms/send-mms.php b/messages/mms/send-mms.php index 7d5ba8b..3b42093 100644 --- a/messages/mms/send-mms.php +++ b/messages/mms/send-mms.php @@ -10,7 +10,7 @@ $client = new \Vonage\Client($keypair); $image = new \Vonage\Messages\MessageObjects\ImageObject( - 'https://example.com/image.jpg', + MESSAGES_IMAGE_URL, 'A MMS image message, with caption, sent using the Vonage Messages API' ); @@ -20,4 +20,4 @@ $image ); -$client->messages()->send($mms); \ No newline at end of file +$client->messages()->send($mms); From c996d762bf140dc85207786c55db4a1078447db7 Mon Sep 17 00:00:00 2001 From: Chuck MANCHUCK Reeves Date: Mon, 24 Mar 2025 13:56:15 -0400 Subject: [PATCH 43/46] refactor: updated variables for verify --- messages/sms/send-sms.php | 2 +- verify/request_with_workflow.php | 6 +++--- verify2/cancel-request.php | 4 ++-- verify2/send-request-email.php | 2 +- verify2/send-request-silent-auth.php | 2 +- verify2/send-request-sms.php | 2 +- verify2/send-request-voice.php | 2 +- verify2/send-request-whatsapp-interactive.php | 2 +- verify2/send-request-whatsapp.php | 2 +- verify2/send-request-with-fallback.php | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/messages/sms/send-sms.php b/messages/sms/send-sms.php index 958aabd..50983b1 100644 --- a/messages/sms/send-sms.php +++ b/messages/sms/send-sms.php @@ -9,7 +9,7 @@ $client = new \Vonage\Client($keypair); -$sms = new \Vonage\Messages\MessageType\SMS\SMSText( +$sms = new \Vonage\Messages\Channel\SMS\SMSText( TO_NUMBER, FROM_NUMBER, 'This is an SMS sent using the Vonage PHP SDK' diff --git a/verify/request_with_workflow.php b/verify/request_with_workflow.php index eba2032..b117de1 100644 --- a/verify/request_with_workflow.php +++ b/verify/request_with_workflow.php @@ -1,4 +1,4 @@ -verify2()->cancel(REQUEST_ID); \ No newline at end of file +$client->verify2()->cancelRequest(REQUEST_ID); diff --git a/verify2/send-request-email.php b/verify2/send-request-email.php index eb9e92e..7c76186 100644 --- a/verify2/send-request-email.php +++ b/verify2/send-request-email.php @@ -7,5 +7,5 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\EmailRequest(TO_EMAIL, 'my-verification'); +$newRequest = new \Vonage\Verify2\Request\EmailRequest(TO_EMAIL, VERIFY_BRAND_NAME); $client->verify2()->startVerification($newRequest); diff --git a/verify2/send-request-silent-auth.php b/verify2/send-request-silent-auth.php index 370bace..408e1ff 100644 --- a/verify2/send-request-silent-auth.php +++ b/verify2/send-request-silent-auth.php @@ -7,5 +7,5 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\SilentAuthRequest(TO_NUMBER, 'my-verification'); +$newRequest = new \Vonage\Verify2\Request\SilentAuthRequest(VERIFY_NUMBER, VERIFY_BRAND_NAME); $client->verify2()->startVerification($newRequest); diff --git a/verify2/send-request-sms.php b/verify2/send-request-sms.php index 6d3376a..634418b 100644 --- a/verify2/send-request-sms.php +++ b/verify2/send-request-sms.php @@ -7,5 +7,5 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\SMSRequest(TO_NUMBER, 'my-verification'); +$newRequest = new \Vonage\Verify2\Request\SMSRequest(VERIFY_NUMBER, VERIFY_BRAND_NAME); $client->verify2()->startVerification($newRequest); diff --git a/verify2/send-request-voice.php b/verify2/send-request-voice.php index b0d76cc..4e6201b 100644 --- a/verify2/send-request-voice.php +++ b/verify2/send-request-voice.php @@ -7,5 +7,5 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\VoiceRequest(TO_NUMBER, 'my-verification'); +$newRequest = new \Vonage\Verify2\Request\VoiceRequest(VERIFY_NUMBER, VERIFY_BRAND_NAME); $client->verify2()->startVerification($newRequest); diff --git a/verify2/send-request-whatsapp-interactive.php b/verify2/send-request-whatsapp-interactive.php index 0645594..e62823e 100644 --- a/verify2/send-request-whatsapp-interactive.php +++ b/verify2/send-request-whatsapp-interactive.php @@ -7,5 +7,5 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\WhatsAppInteractiveRequest(TO_NUMBER, 'my-verification'); +$newRequest = new \Vonage\Verify2\Request\WhatsAppInteractiveRequest(VERIFY_NUMBER, VERIFY_BRAND_NAME); $client->verify2()->startVerification($newRequest); diff --git a/verify2/send-request-whatsapp.php b/verify2/send-request-whatsapp.php index c059566..8d82c9d 100644 --- a/verify2/send-request-whatsapp.php +++ b/verify2/send-request-whatsapp.php @@ -7,5 +7,5 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\WhatsAppRequest(TO_NUMBER, 'my-verification'); +$newRequest = new \Vonage\Verify2\Request\WhatsAppRequest(VERIFY_NUMBER, VERIFY_BRAND_NAME); $client->verify2()->startVerification($newRequest); diff --git a/verify2/send-request-with-fallback.php b/verify2/send-request-with-fallback.php index 06ebfe6..f2878df 100644 --- a/verify2/send-request-with-fallback.php +++ b/verify2/send-request-with-fallback.php @@ -7,7 +7,7 @@ new Vonage\Client\Credentials\Keypair(VONAGE_APPLICATION_PRIVATE_KEY_PATH, VONAGE_APPLICATION_ID), ); -$newRequest = new \Vonage\Verify2\Request\SilentAuthRequest(TO_NUMBER, 'my-verification'); +$newRequest = new \Vonage\Verify2\Request\SilentAuthRequest(VERIFY_NUMBER, VERIFY_BRAND_NAME); $emailWorkflow = new \Vonage\Verify2\VerifyObjects\VerificationWorkflow(\Vonage\Verify2\VerifyObjects\VerificationWorkflow::WORKFLOW_EMAIL, TO_EMAIL); $newRequest->addWorkflow($emailWorkflow); $client->verify2()->startVerification($newRequest); From 1f1af4f9670bded4dda004c00e67b6cd49b53f7a Mon Sep 17 00:00:00 2001 From: Dwane Hemmings Date: Fri, 12 Sep 2025 11:55:59 -0400 Subject: [PATCH 44/46] Update phone number constants for Vonage integration --- voice/connect-call-slim/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/voice/connect-call-slim/index.php b/voice/connect-call-slim/index.php index 2fabb05..5e9b318 100644 --- a/voice/connect-call-slim/index.php +++ b/voice/connect-call-slim/index.php @@ -10,16 +10,16 @@ $dotenv = Dotenv::createImmutable(__DIR__); $dotenv->load(); -define('YOUR_SECOND_NUMBER', getenv('YOUR_SECOND_NUMBER')); -define('VONAGE_NUMBER', getenv('VONAGE_NUMBER')); +define('VOICE_TO_NUMBER', getenv('VOICE_TO_NUMBER')); +define('VONAGE_VIRTUAL_NUMBER', getenv('VONAGE_VIRTUAL_NUMBER')); $app = new \Slim\App(); $app->get('/webhooks/answer', function (Request $request, Response $response) { - $numberToConnect = new \Vonage\Voice\Endpoint\Phone(YOUR_SECOND_NUMBER); + $numberToConnect = new \Vonage\Voice\Endpoint\Phone(VOICE_TO_NUMBER); $action = new \Vonage\Voice\NCCO\Action\Connect($numberToConnect); - $action->setFrom(VONAGE_NUMBER); + $action->setFrom(VONAGE_VIRTUAL_NUMBER); $ncco = new \Vonage\Voice\NCCO\NCCO(); $ncco->addAction($action); From 4a4b4d0c6b19988be0c1cf817a819183480cdf27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Poynter-Smith?= Date: Wed, 24 Sep 2025 21:43:32 +0100 Subject: [PATCH 45/46] Update namespace for snippet (#107) --- sms/send-signed-sms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sms/send-signed-sms.php b/sms/send-signed-sms.php index 2a2b83f..99e5270 100644 --- a/sms/send-signed-sms.php +++ b/sms/send-signed-sms.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/../config.php'; require_once __DIR__ . '/../vendor/autoload.php'; -$signed = new Nexmo\Client\Credentials\SignatureSecret( +$signed = new \Vonage\Client\Credentials\SignatureSecret( VONAGE_API_KEY, VONAGE_API_SIGNATURE_SECRET, 'md5hash' From 2fdaf69f6a4165982b7d524d4a29bb6e576b4a27 Mon Sep 17 00:00:00 2001 From: Chuck Reeves Date: Mon, 6 Oct 2025 10:02:10 -0400 Subject: [PATCH 46/46] feat: added new mms examples (#106) Co-authored-by: Karl Lingiah --- messages/mms/send-mms-content.php | 30 ++++++++++++++++++++++++++++++ messages/mms/send-mms-file.php | 23 +++++++++++++++++++++++ messages/mms/send-mms-text.php | 19 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 messages/mms/send-mms-content.php create mode 100644 messages/mms/send-mms-file.php create mode 100644 messages/mms/send-mms-text.php diff --git a/messages/mms/send-mms-content.php b/messages/mms/send-mms-content.php new file mode 100644 index 0000000..ed1512c --- /dev/null +++ b/messages/mms/send-mms-content.php @@ -0,0 +1,30 @@ +messages()->send($mms); + + diff --git a/messages/mms/send-mms-file.php b/messages/mms/send-mms-file.php new file mode 100644 index 0000000..1f1d869 --- /dev/null +++ b/messages/mms/send-mms-file.php @@ -0,0 +1,23 @@ +messages()->send($mms); + diff --git a/messages/mms/send-mms-text.php b/messages/mms/send-mms-text.php new file mode 100644 index 0000000..8f9ad37 --- /dev/null +++ b/messages/mms/send-mms-text.php @@ -0,0 +1,19 @@ +messages()->send($mms); +