Send WhatsApp message from C# - c#

I was trying to send a WhatsApp message using a console application and all my searches I made on the internet for the same lead me to the NuGet WhatsAppAPI. I understand that because this not being an official client WhatsApp has blocked it currently.
Do we have another way to achieve the same?

After some googling I've found this useful link: https://blog.cloudrail.com/whatsapp-api-how-to-use-the-whatsapp-chat-api/
Basically it says:
At the moment, there is no official WhatsApp API to use. There are
some libraries available which use an unofficial API to send and
receive messages, but this is only limited to a single number. All
those libraries are basically hacks which try to act like a standard
WhatsApp client which you see on Android or iOS in combination with
WhatsApp Web. Nevertheless, there is one official offering by
WhatsApp: the Click to Chat API, which is basically only a link containing a target number and a prefilled text. Once a user clicks on this link, the WhatsApp client (Android, iOS, Web, etc) opens with a new message to the prefilled number with the prefilled text. This is a cool way to add a fast contact option for example if you want to sell your car. (see this link for more about 'WhatsApp Click To Chat': https://faq.whatsapp.com/en/android/26000030/?category=5245251).
If you want to play around with messaging platforms to build chatbots or other systems, have a look at Facebook Messenger, Telegram, Viber, Slack or Line.
Hope this helps
Update 19.05.2022: Meta just anounced a public API for businesses of any size. I will update this answer as soon as there are more infos about this.
Source: https://www.facebook.com/4/posts/10114482926371251/

After some digging: "WhatsApp is intentionally a closed system without an API for external access."
You will have to embrace skillz/madness to pull this off, which, sadly, we will not publicly help you with.
Bon chance!

Related

How to send individual message to a specific phone number via Telegram like a SMS (C# winforms)

I'm developping an application that have to send messages to my users, so I chose the Telegram because it is popular and easy to use. I'm new in development to Telegram and I need some directions.
So, each user have this application installed in a PC, it have a config window where the user can register the phone number, email and some personal info. Also, this software stays ON all day long and when some events happens it must send alerts to the user's phone (like SMS), and this is my problem, I don't know which approach is better, using the normal Telegram API or a bot. I have no idea how to start this.
Is the Telegram a good choice? Is possible to send a message when I have just the phone number? If so, how?
Here is an answer on Telegram API vs Bot API. I generally agree to use Telegram as a media of notification system if it's not possible for you to install your own App on user phones and create your own notification. On another hand, if you have the resource, you can use traditional method such as SMS and Call for notification.

access Lync / Skype for Business conversation in C#

I'm facing a use case, where it shall be possible to take over a Lync/Skype for Business Conversation into my Software. The help desk user was contacted by a customer via Skype for Business and now needs to create a ticket from that conversation. Only the chat-conversation is needed, no voip conversations or so.
I could not find any documentation about how to start any Actions out of a Skype for Business conversation window.
I'm sure, somebody solved that before.
Note that:
- "Skype for Business" is basically a rebranded Lync, so Shane's advice about the "Lync Client SDK" is correct.
- "Skype" != "Skype for Business". It's like java and javascript, totally different, just similar names for branding.
- Persistent Chat means "chat rooms that remain". Skype for Business has regular IM chat and its much less used "Persistent Chat".
- tel.red can do this for you if you pay them.
I think what you want is to use the Lync Client SDK specifically the parts dealing with Persistent Chat, there are samples you can play with.
If you don't want to integrate into the Lync Client itself, you can go down the UCMA route and create a "bot" that can take part in chat conversations.
Using Skype's own API is probably the best way.
http://www.skype.com/en/developer/
I am not able to get the lync sdk controls to work when Skype for business/lync is running using app-v. it works fine when the program is "installed" though.
when running Skype for business/lync in app-v, the error is basically lync client not found, even though it is obviously running.

Send and Receive Messages between Android App and Winform application

Looked for a long time and didn't find anything that showed this, so I apologize in advance I missed something.
I have an android app running on KitKat (Android 4.4.2) and a Winforms application running Windows 7. I need to send messages between the two of them.
Clearly GCM works to get the message to the Android device. I have code that sends from Winforms to the Android Device using GCM. I cannot find a way to have the Android App send anything BACK though. Is it possible to have a Winforms app RECEIVE a GCM Message? Do I have to use Azure? (All examples there seem to focus on the Windows App store and Windows 8.1 neither one of which can be a solution in this case due to client restraints.)
I'm putting this here in case anyone stumbles across it and has a similar question. This is not really an answer. Still hoping someone comes on here and shows that I am wrong. But after 26 days, no one has even offered a suggestion, so I'm guessing not.
There is no way that I have seen that allows for this the way I had hoped. Windows 7 doesn't have this built in to it (AFAIK). Windows 10 should have it built in, but Windows 7 pre-dates the huge shift to the cloud, and didn't have it in the design. If I were working with something like Xamarin -- which is a cross-platform tool, this might be possible. But there is no concept in Windows 7 for receiving messages from the Cloud.
In order to accomplish this, there would have to be some sort of server added to the mix that could take messages and pass them along via a REST API. This is beyond the scope of what I wanted to code.
The solution I found, and that works for me, is to use Microsofts API that wraps a REST service. This allows for communication to OneDrive, for example. That is what I am using as my intermediary REST server.
Microsoft LIVE SDK
This has a pretty good sample list of Android examples, and can be used for what I need. The good thing is the Upstream is just a simple call, and I don't need to have the Android device poll anything (which kills the battery). The laptop will need to poll OneDrive, but its plugged in so there is no battery life concern.
One thing to be aware of, though, is that Microsoft sort of hints that they don't want a bunch of traffic headed to OneDrive. This is from the overview doc:
Throttling
OneDrive has limits in place to make sure that individuals and apps do
not adversely affect the experience of other users. When an activity
exceeds OneDrive's limits, API requests will be rejected for a period
of time. OneDrive may also return a Retry-After header with the number
of seconds your app should wait before sending more requests.
Although, I have never seen what those limits actually are, so YMMV.

Send messages to Skype "group" chat from .NET?

Is there an easy way to send group chat messages to Skype from .NET? I don't need to respond to any commands or anything, so it doesn't need to be a BOT. Basically, I would run this program on a dedicated box with Skype running as a special user and I would have it report certain information to a specific group chat.
I understand there is a Skype COM library. I have seen examples based on that but I haven't been able to get any traction.
The currently available Skype API for Windows uses WM_COPYDATA to exchange text-based commands for controlling Skype (see the Public API Reference download). There is a new thing called SkypeKit in development but it's a closed beta so I don't know what it will do to enhance the experience.
There appear to have been a few projects here and there that have wrapped the existing public API with some .NET-based calls using C#. These either wrap the basic level messaging system or the COM wrapper, Skype4COM (as you have already seen). A Google search gave me these results that seem to get you started:
Controlling Skype with C#
How to do Skype in C#
C# Example Project for Skype4COM
Based on your experiences, I would look at the first item in this list as it appears to be a directly interacting with the Windows messages (i.e. WM_COPYDATA) rather than Skype4COM.
Sending a chat message to a group
Assuming you utilise the C# wrappers referenced above, here is a rough idea of the commands you'll need from the public API in order to send a chat message to a group.
The command to start a chat is CHAT CREATE. It appears from the documentation that you have to specify each recipient (or target, as the written in the API reference) individually. Whether this can be a group name or not is not made clear, however, the GET GROUP USERS command enables you to obtain the individual users within a specific group.
Once you have a chat, you can use the CHATMESSAGE command to actually post a message.

.NET XBox Live Account API

Is there a .NET API available to get data from your XBox Live account?
All I'm really interested in is who's online, but messages would be cool too. And some sort of event driven notifications of user sign-on would be great, but I'll poll if need be.
Check out the Xbox Community Developer Program.
You can also try and take a look at https://xboxapi.com/
They provide a API system to get all sorts of info.
Example dev: https://xboxapi.com/dev/profile/Major+Nelson
their documentation is here, https://xboxapi.com/documentation
it provides info to get data in PHP json, xml, or dev.
Sadly I dont think anything like Messages and some notifications, only publicly visible info. But if you track profile info one can generate a history and if you poll the online status, you can make a popup or something

Categories

Resources