Coder Social home page Coder Social logo

Comments (22)

Kalebu avatar Kalebu commented on August 17, 2024 2

Hi @Mattia921

Can you run this and let me know if you're able to receive a message?

>>> messenger.send_template("hello_world", "255757xxxxxx", components={})

from heyoo.

Mattia921 avatar Mattia921 commented on August 17, 2024 1

Hi @Kalebu, thanks for your response. The fact is that I do not receive any errors while executing the python code.
This is the output:

2022-11-09 10:49:39,296 - root - INFO - Sending message to 39333***
2022-11-09 10:49:40,604 - root - INFO - Message sent to 39333***

So the code is executed without errors, but I don't actually receive anything on the whatsapp number.
I've already added the receiver into the recipient list inside the Facebook developer portal.
Can be this problem related to the country prefix number? In my case, I've entered the Italian code without the + (so only 39).
I hope I was clear.
Thanks again for your time. Have a nice day

from heyoo.

Kalebu avatar Kalebu commented on August 17, 2024 1

Hi @Mattia921
Can you run this and let me know if you're able to receive a message?

>>> messenger.send_template("hello_world", "255757xxxxxx", components={})

this way works for me, any other method doesn't give any error but doesn't send anything either.

Did you add your number as one of the test numbers to the Facebook developer portal?

You could also try replying first to the number before sending any other message other than the template message

from heyoo.

Kalebu avatar Kalebu commented on August 17, 2024

Hi @emre84 Can you please share the response message in English ?

from heyoo.

emre84 avatar emre84 commented on August 17, 2024

Hi Kalebu,

thanks for the response. This is unfortunately what i get as response(nothingelse as imentiined above)

Output:
2022-11-03 22:51:34,464 - root - INFO - Sending message to 49xxx
2022-11-03 22:51:35,200 - root - INFO - Message sent to 49xxx

from heyoo.

Mattia921 avatar Mattia921 commented on August 17, 2024

Hi Kalebu,

thanks for the response. This is unfortunately what i get as response(nothingelse as imentiined above)

Output: 2022-11-03 22:51:34,464 - root - INFO - Sending message to 49xxx 2022-11-03 22:51:35,200 - root - INFO - Message sent to 49xxx

I have exactly the same problem. Thanks in advance for your time

from heyoo.

Kalebu avatar Kalebu commented on August 17, 2024

Hi @emre84 and @Mattia921 just know you cannot send other messages other than <template_message> to un whitelisted numbers, To able to do this you need to add the number to the recipient list in your Facebook developer portal.

The error translates to

{'error': {'message': '(#131030) Recipient phone number not in allowed list', 'type': 'OAuthException', 'code': 131030, 'error_data': {'messaging_product': 'whatsapp' , 'details': 'Recipient's phone number is not whitelisted: add the recipient's phone number to a recipient list, then try again.'}, 'error_subcode': 2655007, 'fbtrace_id': 'Akf6LRk1j9htPAuzA5P971E'}}

They Allow up to 5 test numbers which you cannot change

Please let me know if you're still having issues

from heyoo.

emre84 avatar emre84 commented on August 17, 2024

Hi @emre84 and @Mattia921 just know you cannot send other messages other than <template_message> to un whitelisted numbers, To able to do this you need to add the number to the recipient list in your Facebook developer portal.

The error translates to

{'error': {'message': '(#131030) Recipient phone number not in allowed list', 'type': 'OAuthException', 'code': 131030, 'error_data': {'messaging_product': 'whatsapp' , 'details': 'Recipient's phone number is not whitelisted: add the recipient's phone number to a recipient list, then try again.'}, 'error_subcode': 2655007, 'fbtrace_id': 'Akf6LRk1j9htPAuzA5P971E'}}

They Allow up to 5 test numbers which you cannot change

Please let me know if you're still having issues

I added also in the recipient list in your Facebook developer portal.

Note:I am sure that my token number, phone_number_id and recipient_id number are correct, with the reason that if I write anything wrong in these fields, I get following error message.:

2022-11-03 23:03:01,945 - root - INFO - Status code: 400
2022-11-03 23:03:01,945 - root - INFO - Response: {'error': {'message': '(#131030) Recipient phone number not in allowed list', 'type': 'OAuthException', 'code': 131030, 'error_data': {'messaging_product': 'whatsapp', 'details': 'Empfänger-Telefonnummer steht nicht auf Positivliste: Füge die Telefonnummer des Empfängers zu einer Empfängerliste hinzu und versuche es dann noch einmal.'}, 'error_subcode': 2655007, 'fbtrace_id': 'Akf6LRk1j9htPAuzA5P971E'}}

from heyoo.

Mattia921 avatar Mattia921 commented on August 17, 2024

Hi @Mattia921

Can you run this and let me know if you're able to receive a message?

>>> messenger.send_template("hello_world", "255757xxxxxx", components={})

Hi @Kalebu, in this case I'am able to receive the message. So since I would like to use the library to upload and then download images, should I always use the send_template method?

Thanks again for your help

from heyoo.

Mattia921 avatar Mattia921 commented on August 17, 2024

Hi Kalebu,

This is my output. messenger.send_template("hello_world", "49xxx", components={}) 2022-11-09 15:37:06,533 - root - INFO - Sending template to 49xxx 2022-11-09 15:37:07,003 - root - INFO - Template not sent to 49xxx 2022-11-09 15:37:07,003 - root - INFO - Status code: 401 2022-11-09 15:37:07,003 - root - INFO - Response: {'error': {'message': 'Error validating access token: Session has expired on Friday, 04-Nov-22 14:00:00 PDT. The current time is Wednesday, 09-Nov-22 06:37:06 PST.', 'type': 'OAuthException', 'code': 190, 'error_subcode': 463, 'fbtrace_id': 'A4QGvLtyY9xP-QVKPYRWMjX'}}

Note:I tried also +49xxx, 0049xxx, but none of them worked.

Since the access token updates every 24 hours, did you use the new one?

from heyoo.

soerenetler avatar soerenetler commented on August 17, 2024

I had many similar problems in the beginning and It just got solved with a new Facebook Business Profile.
As far as I see this is not a issue with the heyoo library. Does it work to send the same messege in e.g. Postman?

from heyoo.

Mattia921 avatar Mattia921 commented on August 17, 2024

I had many similar problems in the beginning and It just got solved with a new Facebook Business Profile. As far as I see this is not a issue with the heyoo library. Does it work to send the same messege in e.g. Postman?

Hi @soerenetler, I've just tried with postman and I obtain the same result.
If I use the "type"="template" everything works fine, as with the wrapper of the heyoo library. On the other hand, with the "type"="text" (equivalent to the heyoo method send_message), the API call works but I don't receive anything on the WhatsApp number.

I will try with a new Facebook Business profile as you suggest. Thanks

from heyoo.

Mattia921 avatar Mattia921 commented on August 17, 2024

I had many similar problems in the beginning and It just got solved with a new Facebook Business Profile. As far as I see this is not a issue with the heyoo library. Does it work to send the same messege in e.g. Postman?

Hi @soerenetler, I've just tried with postman and I obtain the same result. If I use the "type"="template" everything works fine, as with the wrapper of the heyoo library. On the other hand, with the "type"="text" (equivalent to the heyoo method send_message), the API call works but I don't receive anything on the WhatsApp number.

I will try with a new Facebook Business profile as you suggest. Thanks

I've tried with a new Business profile but I could not solve the problem

from heyoo.

SrVitinho avatar SrVitinho commented on August 17, 2024

I'm currently having the exact same problem, I've done all steps and still no message

from heyoo.

orkunozturk avatar orkunozturk commented on August 17, 2024

@emre84

Currently, customers in Turkey cannot receive messages sent by businesses using Cloud API. However, businesses in Turkey are still able to send messages using the Cloud API.

https://developers.facebook.com/docs/whatsapp/cloud-api/support/troubleshooting#message-not-delivered

from heyoo.

elimardom avatar elimardom commented on August 17, 2024

Hi @Mattia921

Can you run this and let me know if you're able to receive a message?

>>> messenger.send_template("hello_world", "255757xxxxxx", components={})

this way works for me, any other method doesn't give any error but doesn't send anything either.

from heyoo.

emre84 avatar emre84 commented on August 17, 2024

Hi,

Thanks for the response. Following code works fine for me either:

messenger.send_template("hello_world", "255757xxxxxx", components={})

But I can just send template messages with this command.
isn't it possible to use messenger.send_message? I do not want to use any templates.

from heyoo.

germor24 avatar germor24 commented on August 17, 2024

Hi @Mattia921
Can you run this and let me know if you're able to receive a message?

>>> messenger.send_template("hello_world", "255757xxxxxx", components={})

this way works for me, any other method doesn't give any error but doesn't send anything either.

Did you add your number as one of the test numbers to the Facebook developer portal?

You could also try replying first to the number before sending any other message other than the template message

Replying first to the number solve the problem. Thanks.

from heyoo.

Radi-dev avatar Radi-dev commented on August 17, 2024

Is anyone still having this issue?
Here are the common causes:

  • You're sending a media that includes a broken link.
  • Your message content has broken a Whatsapp messaging rule. For example:
    • Having a button with text that is more than 20 characters will result in a success response, but the message will not be sent to the user.
    • Having interactive message that includes more than the specified 3 buttons or more than the specified 10 list items will result in the same thing.
    • Having a footer with text that is more than 20 characters will result in same.
  • You are trying to send a non-template message to a user who hasn't messaged your bot within the last 24 hours.(This should actually throw an error)

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

I had this problem the very first time I set up the Facebook Dev Portal, fixed it by sending an SMS to the test number.

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

image

Okkk so I got this issue again, this was the fix

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

Just send a template message and you are done!

from heyoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.