Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Whatsapp attachment
Message
From
06/11/2020 06:11:23
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Whatsapp attachment
Miscellaneous
Thread ID:
01677044
Message ID:
01677044
Views:
90
Sir I am using these code to send text message on whatsapp.


There is no issue.

But now I want to send PDF document or image on whatsapp
Declare  Integer FindWindow In WIN32API String , String
Declare  Integer SetForegroundWindow In WIN32API Integer
Declare  Integer  ShowWindow  In WIN32API Integer , Integer
Declare Integer ShellExecute In shell32.Dll ;
	INTEGER hndWin, ;
	STRING cAction, ;
	STRING cFileName, ;
	STRING cParams, ;
	STRING cDir, ;
	INTEGER nShowWin

Local lt, lhwnd

cPhone=[9203000000000]
cMessage='How are you sir?'

cmd='whatsapp://send?phone=&cPhone&text=&cMessage'


=ShellExecute(0, 'open', cmd,'', '', 1)

Wait "" Timeout 3
lt = "Whatsapp"
lhwnd = FindWindow (0, lt)
If lhwnd!= 0 					
	SetForegroundWindow (lhwnd) 
	ShowWindow (lhwnd, 1)
	ox = Createobject ( "Wscript.Shell" )
	ox.sendKeys ( '{ENTER}' )
Else
	Messagebox ( "Whatsapp no activated!" )
Endif]
to do this, I visited these links

https://developers.sinch.com/docs/whatsapp-message
https://www.example-code.com/foxpro/whatsapp_send_linked_media_message.asp
https://faq.whatsapp.com/iphone/chats/how-to-send-media

But could not found how to modify this line of code
cmd='whatsapp://send?phone=&cPhone&text=&cMessage'
I mean what to add in api string to send document?

Update:
While using codes from this link
https://docs.cmtelecom.com/en/api/business-messaging-api/1.0/index

I modified my string like this
mediaName="conversational-commerce"
mediaUri="https://www.cm.com/cdn/web/nl-nl/blog/conversational-commerce.jpg"
mimeType= "image/jpg"
cmd='whatsapp://send?phone=&cPhone&media=&mediaName&Url=&mediaUri&type=mimeType'
but it still not work

Please help
Reply
Map
View

Click here to load this message in the networking platform