Using different phone numbers in whatsapp business api account - rest

Following to this documentation https://developers.facebook.com/docs/whatsapp/business-management-api/phone-numbers about whatsapp business accounts, it is possible to have multiple phone numbers in one account. Does someone know how you can define from which number a message is send, when sending a message to a client?
There is nothing in the api about sending messages.
following to the documentation you can read the phone numbers and their whatsapp id via
curl -X GET \
'https://graph.facebook.com/v3.3/your-whatsapp-business-account-id/phone_numbers' \
-d 'access_token=your-access-token'
example result
{
"data": [
{
"verified_name": "Jasper's Market",
"display_phone_number": "+1 631-555-5555",
"id": "1906385232743451",
"quality_rating": "GREEN"
},
{
"verified_name": "Jasper's Ice Cream",
"display_phone_number": "+1 631-555-5556",
"id": "1913623884432103",
"quality_rating": "NA"
}
],
}
I would expect something like a senderId field when sending a message.

There are two parts to a WhatsApp Business API - WhatsApp Account on Business Manager (Facebook), and WhatsApp Business API Client (docker images).
What you're looking at is the WhatsApp account information from Business Manager.
Once you've added a phone number with a verified_name, you need to download the certificate from Business Manager and use that certified to register your WhatsApp Business API client (docker containers).
Each client is registered with a specific phone number, so you know what phone number you're using to send the messages.
This is equivalent to having a separate cell phone for every separate phone number and WhatsApp app on that cell phone.
Follow the official WhatsApp documentation, to get more detailed information about the setup.

Related

Add/Delete phone number in whatsapp business account using api

I want to add/delete phone numbers to a WABA account. It can be done through UI but is there any endpoint to do the same ?
I didn't find any in documentation.

Why is PayPal REST api pay by credit card option showing on desktop, not showing on mobile?

After a lot of digging around I have finally managed to get something working with the PayPal REST API, the documentation is awfully confusing.
I'm creating a C#/MAUI mobile app where I need to take payments.
Anyway, I managed to get the PayPal API it to create this URL, below (I can simulate the same thing using Postman)
https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXXXXX
Get an access token (access_token) using the REST API
POST to https://api-m.sandbox.paypal.com/v2/checkout/orders/ this payload
{
"intent": "CAPTURE",
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"amount": {
"currency_code": "USD",
"value": "100.00"
}
}
]
}
The returned payload gives me this json. There are other kinks in the returned payload but this is the one I need.
{
"href": "https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXX",
"rel": "approve",
"method": "GET"
}
Using that URL, on a desktop PC browser I get the option to log-in or "pay by debit or credit-card" but on mobile browser I only get the option to create an account or log-in to an existing account, using that exact same URL.
Does, anybody know whats going on here? How do I get the same options in a mobile browser. I can't find anything in the documentation that explains this behaviour.
Guest availability in the paypal.com checkout depends on very many factors, including the IP address and geographic location of the buyer, the amount of the transaction, the device used, and any number of other things. Other than disabling guest as a possibility in your account options, you cannot control this behavior of the PayPal page.
A 'Debit or Credit Card' button on your own page can be added using the JS SDK for approval, rather than redirecting away. Here is a demo, which would fetch the created order id/token from your server.

Is there an API endpoint to see if a phone number is "in service" with our account

I'm new to the Twilio API. I'd like to verify whether a set of phone numbers is "in service" with our account. These are phone numbers like PN0c8XXXX...... and is there a way to send numbers in bulk to be sure that they are associated with our account and in working order? I see a call like this (would Sid be our PN0c8... number?):
GET https://verify.twilio.com/v2/Services/{Sid}
but not clear if this is what we want or if it supports batch mode. Any ideas?
I'm not entirely sure what you mean by verifying a set of phone numbers in "in service" with your account.
However, you can check the details of a phone number in your account using the Incoming Phone Numbers API. If you have a phone number SID, the ID that starts with PN, you can fetch an individual phone number resource by making a request to:
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}.json
There isn't an API request that allows you to send multiple SIDs, but you can list all your incoming phone numbers and then check against that list in your own code.
As an aside, the URL you asked about in the question is the Twilio Verify API. Verify allows you to verify user's phone numbers over SMS or voice, and can also perform verification via TOTP, push notification or emails. It's meant for verification or two factor authentication.

Google Play Developer API purchases.subscriptions doesn't return emailAddress field

I'm integrating with Google Play Developer API (https://developers.google.com/android-publisher). To be more specific I'm trying to get informations about a specific subscription (https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/get).
Well I'm already getting informations about a subscription with the subscriptionId and purchaseToken. The problem is that some fields are not being returned in response. One of these field is emailAddress that importante for my usage context. I'm getting a response like the one shown below.
{
"startTimeMillis": "1631112305355",
"expiryTimeMillis": "1638981894973",
"autoRenewing": true,
"priceCurrencyCode": "BRL",
"priceAmountMicros": "39990000",
"countryCode": "BR",
"developerPayload": "",
"paymentState": 1,
"orderId": "GPA.9999-5849-9341-89139",
"acknowledgementState": 1,
"kind": "androidpublisher#subscriptionPurchase"
}
From the docs about emailAddress we have The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
But what is Subscribe with Google? Isn't Google Play Billing in this category? My purchases are made on an Android mobile app with Play Billing.
Thanks any help.
Subscribe with Google is a completely different thing that Google offers or at least used to offer, these are not normal subscriptions, for normal subs you do not get the users email.
Subscribe with Google lets you buy a subscription, using your Google
account, on participating news sites. Select the publisher offer you’d
like to buy, click “Subscribe,” and you’re done. You’ll automatically
be signed in to the site, and you can pay–securely and privately—with
any credit card you’ve used with Google in the past.
https://blog.google/outreach-initiatives/google-news-initiative/introducing-subscribe-google/

Using Whatsapp Business API number in API and in app

I've recently been trying to get all messages sent and received by a Whatsapp Business account. At the moment im using the MessageBird API in order to do this, but as soon as I add the phone number in Facebook Whatsapp Manager im not able to use the number on the Whatsapp Business App. (Phonenumber is invalid)
What am I doing wrong? All I want to do is:
Use the phonenumber in the WA Business App to send and receive messages.
Use the phonenumber in the MessageBird API to get a list of conversations and all messages sent and received in this conversation.
Unfortunately, this is not possible. Once the number is registered with WhatsApp Business API it cannot be used with the Consumer or SMB App.
https://developers.facebook.com/docs/whatsapp/guides/phone-number#pick-number