Send messages to Skype "group" chat from .NET? - c#

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.

Related

Can microsoft team app be used in UI suppression mode as Skype for business?

I have WPF program as a Kiosk application using Lync sdk to make 2-way video call. I want to make similar application but using Microsoft team. The step is as below:
kiosk app calls recipient -> recipient accepts call and sees video streaming from a person standing in front of kiosk app.
kiosk also gets video streaming sent back from recipient and shows that on app interface.
users at kiosk side will only see custom interface we develop, not Lync/Microsoft Teams UI.
As far as I understand for Teams, native app (kiosk) needs to call bot api and bot will call MS Graph via REST and Graph will create a call to recipient. I don't quite understand how to proceed after that:
How caller (kiosk) can receive video streaming from recipient?
How caller (kiosk) side turn on camera programmatically?
In Lync, we will install Lync libraries and Lync client on application side, then Lync will handle this itself, so the app using Lync will create a call directly to callee.
In Teams, it's different as the app needs to call Graph to create a call. So I am really confused how to do this.
The Lync Client SDK remote controls the Lync Client. There is no such SDK for the teams app (the teams app is basically just a web browser, going to the teams web site is basically the same app minus the audio\video support).
So there is no way to do a UI-Suppression mode.
What you can to is control the teams app using the Windows Automation Api. Using this API you can remote control the teams app to do what you want.
There is a bunch of applications written using this API for you to try manually like the Microsoft Testing Tools or Automation Sky. Once you have found how to do what you want using these tools then you need to convert your manual usage of these tools over into code to remote control the Microsoft Teams application.
I know it generally works as we have remote control the teams applications here. The problems you will find is that the Teams application is really just a "special" web browser to display the Teams web site. This means it can and does change A LOT. So you remote controlling of the Teams application may break at any time. So you may to program your solution to be as dynamic as possible so that you can update how you control the Teams application either live or as quickly as you can.

Send WhatsApp message from 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!

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.

Skype plugin in C#

I write system, that collects informations about local system. It's a system like admin-client. Client collects and sends log to admin. There's of course possibility to get this log by admin over LAN, but I'd like to add option send log over Internet.
I thought about skype. Client must have logged skype and when admin (of course there must be appropriate authorization, but it's separate topic) send request by skype - client must e.g. connect to SQL database or simple file with collected log and send it over skype.
How can I do this?
Is this the best way? Plugin in skype? What lib may I use?
I think it's an either/or situation.
If you want an administrator who is already using Skype to be able to send this information over the internet, then a plugin which exposes that functionality in Skype is the way to go.
If you want the administrator to be able to send the information over Skype's network, but not necessarily have to have the application running (perhaps this will be done through the application that gathers data), then using the API to control Skype externally is better.
You can find the documentation for Skype here:
http://developer.skype.com/accessories
Skype has a COM API called Skype4COM which you could use through COM interop in order to access Skype.
It should be noted that SkypeKit is now available for use in both embedded and desktop programs. There's a small one-time registration fee (currently $5 USD) for each program, but it will allow you to access Skype without actually using any UI functionality (it's completely up to you to provide the interface).
Until SkypeKit is released, you're limited to the Skype Public API. However according to the docs this API only allows to specify the recipient and open the file dialog, initiating a file transfer automatically seems to be impossible (see "OPEN FILETRANSFER" in the docs).
I suggest you use an open protocol like HTTP or FTP instead.

Integrating pocket outlook and C# application

I am hoping someone can help me by pointing in the right direction with a problem I have
I want to be able to create appointments using Outlook\Exchange server and sync those to my device using pocket outlook. On the device I want to be able to open the appointments application on the device, clicking on a menu option and pass the appointment details to another application (which I am writing also).
Any ideas? How easy is this to do and where is the best place to start looking for working how to pass data between outlook and my application? I've read the POOM section on msdn and think I can do the menu option but dont know the best way to tackle the integration. The Other application is written in C#.
Thanks
Morris
This sounds like you are asking more about inter-process communication between your pocket outlook plugin and your 'other' app. Given that you should be able to get the id of the appointment from the outlook plugin/menu item etc. then you can use a number of methods to pass that id to your other app, and then have it open the appointments collection and find the right appointment via POOM.
This could be as simple as sending your other app a windows message with the id as the LPARAM and use a messagewindow in your other app to receive the message. (Not sure if the id will fit in LPARAM though, WM_COPYDATA could be an alternative), however this approach needs some handshaking at the start to pass the window handles to each other.
You could use P2P (Point to point) message queues between the two processes, or tcp/ip sockets.
One other way could be for the pocket outlook plugin to mark the appointments with a custom property, and then just use a named event to signal to the other app to do it's thing, and it could find all the marked appointments via POOM and process them.

Categories

Resources