netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
456 stars 166 forks source link

Send message not working #5

Closed kevinnyotosusanto closed 2 years ago

kevinnyotosusanto commented 2 years ago

Hello, i tried to use the class and send message but nothing happen and im not receiving any message. i installed using composer and then include the class then i have this code

$whatsapp_cloud_api = new WhatsAppCloudApi([ 'from_phone_number_id' => 'xx', 'access_token' => 'xx', ]);

$whatsapp_cloud_api->sendTextMessage('xx', 'Hey there! I\'m using WhatsApp Cloud API. Visit https://www.netflie.es');

am i wrong? btw i used the temporary token

aalbarca commented 2 years ago

Hi,

  1. Send a first message from the developer console in Facebook. Please check the Setup Guide.
  2. Reply to the previous message from you WhatsApp App installed in your phone
  3. Now you can use the Cloud API

Remember that you only can send messages from and to your configured testing mobiles in a testing environment.

Best regards, Alex.

aalbarca commented 2 years ago

@kevinnyotosusanto Was your problem resolved?

kevinnyotosusanto commented 2 years ago

@kevinnyotosusanto Was your problem resolved?

im going to try that now.. will reply soon, thankyou for response

kevinnyotosusanto commented 2 years ago

@netflie okay its now working with test number and temporary token. thankyou

kevinnyotosusanto commented 2 years ago

hi sorry to ask again, is it a must to do the 3 step above (send msg from developer console, reply then use the cloud api) everytime i need to send msg to another number? or is it just first time using cloud api? thanks

boynet commented 2 years ago

@kevinnyotosusanto when your number get verified you will be able to send approved template message to any number, without this steps. whatsapp now allowing you to send free form messages unless you are in the 24 hour windows from last customer replay

hacker-prime commented 1 year ago

@kevinnyotosusanto Were you able to make it work with an approved number rather than a test number?

hacker-prime commented 1 year ago

@boynet How do you get your number verified?

kevinnyotosusanto commented 1 year ago

@hacker-prime i only tested this with fb test number so i only send message to registered number. havent try use my own number and send to any number. if you want to send template msg u can do it to any number but need other ppl to text you first to be able to send message that not in your template msg.