Topic: whatsapp api message send
whatsapp api message send exampale code please.......
api websites list
My Visual Database → General → whatsapp api message send
whatsapp api message send exampale code please.......
api websites list
HELP ME
We don't understand your message, no one will answer you.
Hello epancard, salut Destiny
In France, we have a maxim that says:
' What is well conceived is clearly expressed
and the words to express it come easily' .
So, correctly reformulate the problem you want to present to us and what you expect from us.
JB
<?php
//The idInstance and apiTokenInstance values are available in your account, double brackets must be removed
$url = 'https://7105.api.greenapi.com/waInstanc … 0b4e4146a5';
//chatId is the number to send the message to (@c.us for private chats, @g.us for group chats)
$data = array(
'chatId' => '@c.us'
);
$options = array(
'http' => array(
'header' => "Content-Type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data)
)
);
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
echo $response;
?>
this code php convert mvd code please
api whatsapp massage send code
website is https://green-api.com/en
The example I made, is it the one you want?
Try Code
procedure Form1_Button2_OnClick (Sender: TObject; var Cancel: boolean);
var
WinHttpReq : Variant;
url : String ;
body : TStringlist;
begin
Try
WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
url := Form1.Edit6.Text ;
body := Tstringlist.create ;
body.add('{"chatId": "'+Form1.Edit4.Text+'","message": "'+Form1.Edit5.Text+'"}');
WinHttpReq.Open('Post',url,False);
WinHttpReq.SetRequestHeader('Content-Type', 'application/json');
WinHttpReq.Send(body.Text);
Form1.Edit7.Text := WinHttpReq.StatusText ;
Form1.Memo1.Text := WinHttpReq.ResponseText ;
body.Free ;
Except
End;
end;
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
Form1.Edit6.Text :=
Form1.Edit1.Text+'/waInstance'+Form1.Edit2.Text+'/sendMessage/'+Form1.Edit3.Text ;
end;
begin
end.
Reference From https://green-api.com/en/docs/api/sending/SendMessage/
Delphi
program sendMessage;
{$APPTYPE CONSOLE}
uses
System.SysUtils,
System.Classes, System.Net.HttpClient, System.Net.URLClient, System.Net.HttpClientComponent;
var
HttpClient: TNetHTTPClient;
RequestBody: TStringStream;
RequestHeaders: TNetHeaders;
Response: IHTTPResponse;
EndpointURL, ID_INSTANCE, API_TOKEN_INSTANCE: string;
begin
ID_INSTANCE := '110100001';
API_TOKEN_INSTANCE := 'd75b3a66374942c5b3c019c698abc2067e151558acbd451234';
EndpointURL := 'https://api.greenapi.com/waInstance' + ID_INSTANCE + '/sendMessage/' + API_TOKEN_INSTANCE;
HttpClient := TNetHTTPClient.Create(nil);
RequestBody := TStringStream.Create('{ "chatId": "71234567890@c.us", "message": "test" }', TEncoding.UTF8);
RequestHeaders := [
TNetHeader.Create('Content-Type', 'application/json')
];
try
Response := HTTPClient.Post(EndpointURL, RequestBody, nil, RequestHeaders);
if Response.StatusCode = 200 then
Writeln('[Response]: ' + Response.ContentAsString)
else
Writeln('[ERROR ' + IntToStr(Response.StatusCode) + ']:' + Response.StatusText + '' + Response.ContentAsString);
readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
HttpClient.Free;
RequestBody.Free;
end.
Thankyou very much all
My Visual Database → General → whatsapp api message send
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi