Coder Social home page Coder Social logo

Comments (20)

filipporomani avatar filipporomani commented on August 17, 2024

Did you include the prefix in the phone number?
Like if it's +39 the number should be "39xxxxx"

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024

@filipporomani Thanks for the quick response. Yes I did. 972 is the prefix

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

Try to also add preview_url=False in the send_message arguments

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

and also try to do this:

token = 'EAAC14******'
messenger = WhatsApp(token,phone_number_id='12598*******')

msg = messenger.send_message('Hello I am WhatsApp Cloud API', '972*******')
print(msg) 

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024
msg = messenger.send_message('Hello I am WhatsApp Cloud API', '972*******')
print(msg) 

Same result

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

so that you can see the full response output and get the error code. If you want to send the output it gives i may help you further.

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024
print(msg)

This is the output:

{'messaging_product': 'whatsapp', 'contacts': [{'input': '972*****', 'wa_id': '972*****'}], 'messages': [{'id': 'wamid.HBgMOTcyNTIzMjY4ODg4FQIAERgSMjhDNkE4RTBCNTJDMjUwRDYwAA=='}]}

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

same error for me. that's strange. lemme check with the api docs.

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024

same error for me. that's strange. lemme check with the api docs.

That's good news for me :-)

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

have you got the payment method setted up on the facebook dev portal?

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024

Not yet. Is it a must while using only their test number?

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024

Please note that from the API setup page the "send message" button works well
image

So I am not sure it is a payment issue

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

it's not then

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

try to send a message to the test number from your phone
and then try to send again via your code

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024

WOW!! That did the job!!! THANKS.

Can you explain why?

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

Facebook doesn't let you send custom messages to users if they don't start a conversation with you in the past 24 hours. If they don't start a conversation you can only send template messages to them (which is what you did with the send message button to test it).

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024

That is great. BUT does it mean that this will happen also on my regular usage of this service?
Is there a way to avoid the 24hours issue?

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

Sadly there is not. Btw you can edit the templates as you like, create new ones (you can also add variables to them) and send them directly.

from heyoo.

phantom153 avatar phantom153 commented on August 17, 2024

Ok. I will investigate this. Many thanks for your quick help!!

from heyoo.

filipporomani avatar filipporomani commented on August 17, 2024

Happy to help! :-)

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.