HttpAddRequestHeaders(hRequest, HeaderData.c_str(), HeaderData.size(), NULL) ĬryptBinaryToString(attachment, length, CRYPT_STRING_BASE64, NULL, &desiredLength) HeaderData += _T( " \r\nX-WM-CLIENT-SECRET: ") HINTERNET hRequest = HttpOpenRequest(hConnectHandle, _T( " POST"),ĭOCUMENT_API_PATH, NULL, NULL, AcceptTypes, 0, 0) HConnectHandle = InternetConnect(hOpenHandle,Ĭonst wchar_t *AcceptTypes = HOpenHandle = InternetOpen(_T( " HTTP"), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0) LPCTSTR groupAdmin, LPCTSTR groupName, /* LPCTSTR message,*/ LPCTSTR filename,Ĭonst TCHAR* szHeaders = _T( " Content-Type:application/json charset=utf-8\r\n")
Whatsmate client id code#
We will be using CryptBinaryToString().Ĭopy Code bool SGWhatsApp::SendGroupDocument(LPCTSTR ClientID, LPCTSTR ClientSecret, Here is how we convert an image or a document into base64 string. Converting an Image or a Document to base64 Our tool, checks the file's type and uses the API accordingly. So in terms of the API, there is a difference between: Images, however appear inline as part of the message. There is a different API for sending documents, as they appear as "attachment" on the recipient's phone. When images or documents are sent, we can add a "caption" to them which can be our message. When you select a document or an image, the message appears as the caption of the image / document sent. #define GROUP_API_PATH L"/v3/whatsapp/group/text/message/12"įor the purpose of this article, we added some User Interface.Īs you can see, you can enter a message and select a document or an image to be sent with it. Alternatively, I will later attach a compiled (. Here are the building blocks you need to have.
Whatsmate client id pdf#
There are several types of messages that can be sent, including individual or group messages and with or without a photo or PDF file attached to them. Using the Codeįor the GitHub repo, see this one (the class) and this one (the MFC based tool). During our day to day work, we need to set up all sort of alerts to be sent to a group who share a job or work on a feature and when that's done automatically, it makes life easier to be notified. WhatsApp is better than the old SMS because it is free and has more features. WhatsApp is a multi-platform free service for chatting via video or voice and for sending messages to individuals or groups, including files, media, etc. Sending documents and files is a bit more complicated and will be explained in this article. So we wrote our own C++ class for that purpose. However, their code samples for using their services are in almost any programming language except for C++.
![whatsmate client id whatsmate client id](http://www.macobserver.com/imgs/tmo_articles/20140203setclientid.jpg)
As mentioned in part 1, there are several service providers and we have chosen one of them ( WhatsAppMate) and started a free trial.
Whatsmate client id how to#
In this part, I will explain how to send images and documents to a group.
![whatsmate client id whatsmate client id](https://whatsmate.github.io/img/avatar-icon.png)
This article is the second part, following the first part. Download Exe_SG_SendWhatsApp.zip - 986.5 KB.Won the Best Article of November 2018 3rd prize