Is it possible to get information about a WhatsApp bot? - api

As I understand, every WhatsApp chatbot interacts with users through WhatsApp but the actual backend is hosted in a server of its own.
I was wondering if there is any way to get information about this server or its API when interacting with the chatbot. I tried fiddling on WhatsApp web with the developer console, with the network tab, but it appears that WhatsApp does a really good job masking the core of the bots.
Has anyone had any luck getting information about WhatsApp chatbots?

Well from the question it's kinda already answered Meta uses just the response from the server from where the bot script is hosted after sending a webhook event to it so what you might be getting is gonna be info on the WhatsApp network... with the new Cloud API for WhatsApp business you could get more info on how the WhatsApp bot work
(https://developers.facebook.com/docs/whatsapp/cloud-api)

Related

Remote setup Whatsapp web and exposed via API

I have seen some providers on internet where you can send Whatsapp messages using an API. Its not official WA API integration.
These providers will spawn a instance for you, show you a QR code. You need to scan the QR code in your WA app. Once scan is completed, that instance is added as linked device in your app.
Now they provide an API which you can use to send messages. API accepts instanceId, mobile number and message as query param.
These messages are send using your WA account and number. You can see those sent messages in your app.
Basically everything is happening from your account via web whatsapp but from a remote setup and using an API.
Here are a screenshot to help you understand what I am trying to convey.
Sample API call:
https://DOMAIN-HERE/api/send.php?number=84XXXXxxx&type=text&message=test%20message&instance_id=6XXXXXXXXXX&access_token=XXXXXXXXXXXX
I want to setup something similar. I searched the Internet on how does this work and how I can create my own similar setup but could not find anything.
Can someone please point me in the right direction.
What all these providers are doing is hosting a running instance of a whatsapp web client using your phone number, this is why they ask you to scan the QR code (same as whatsapp web does).
Users of this kind of services must be crazy to allow running an unattended instance of whatsapp against their own phone account, as on the host there's full access to your whatsapp encryption keys, contacts, history of messages,... but the security implications are for a different topic.
If you want to have a headless instance of whatsapp-web like the one they offer, you should have a look at repos like this one here: https://github.com/tulir/whatsmeow (there are others similar, for different languages).

Is there a way to trigger rateItem API as a Sonos control device?

We currently use the Sonos Control REST API to communicate with the players. We would like to trigger the SMAPI rateItem for the currently playing item (like the Sonos APP does).
Is it possible by using only the Control API?
or is there a chance to get the SMAPI URL of the service by the serviceId used by the Control API, so that we can send the rateItem request directly to that service?
Is there also a JSON REST API available for the SMAPI or is it still only SOAP?
Thanx in advance
No
is the way to go, but you need to have figured out the auth secrets etc in order to get the url of the service, as well as the user credentials.
The devices only do SOAP APIs. JSON APIs are only used for the cloud API (and for the local, private version of that).
I have never taken my SMAPI support as far as the rating stuff. Older versions of my apps did support the Pandora Like button, but that was when Sonos used the old Pandora API, before they switched it over to SMAPI.

Sonos API - Is it possible to play specific song via API

I'm currently integrating the Sonos Control API into our platform.
I successfully integrated "simple" commands related to play/pause, skipToNextTrack, skipToPreviousTrack but is it possible to access associated music provider to the sonos account through the Control API ?
I don't want to integrate a "simple" remote control for Sonos speakers. I would like to use the Spotify, Deezer or whatever associated provider account to search and play a song. Is there a way to do that?
Thanks for any reply :-)
This is not currently a possibility with the Control API. We'll bring your request back to the dev team.

How to complete OAuth2 authentication on web servers?

Actually I'm working on a Discord Bot which uses Google Sheets as Database using GSpread API, it is hosted on Heroku. So, how to complete authentication ? My Bot is not working.
Make sure to head to Discord Developer Apps and check off PUBLIC BOT at the bottom. This is usually the case 90% of the time with problems like this.

How do I retrieve the catalog of a music service?

I am building an app that integrates nicely with Sonos speakers.
I would like to provide the user the ability to select the container (playlist/stations/...leafs of the tree here) of the music service provider. Say Amazon or Spotify...
I managed to understand the vast majority of the SOAP calls however, I could not figure out how to query the user's selected service (devicelink) and provide the same list that the Sonos controller show.
How do I do that?
thanks!
This is not currently supported by the Sonos APIs and many music services take steps to ensure that only Sonos controllers can browse their catalog.
Sonos decided that access to music services should no longer be allowed by third-party-apps some time ago.
I figured out how it works and made a complete walkthrough here, https://Sonos.svrooij.io/music-services.html
It makes a second connection to the specific music service, just for browsing the catalog.
get some data from the Sonos device
Request an auth code for the service
Let the user login
If the user responded, request an access token and a refresh token.
Save these tokens in your Sonos system (optional)
Use the tokens to talk to the music service
Save and use the new access token if it is expired (optional)
You can also use my sonos-ts library, which has support for music services that require authentication.