Posts tagged with asp.net-core

I am trying to migrate Adwords API(sunset on 27th April, 2022) to Google Ads api. Using Asp.Net Core(5.0) and c#.

Exception: Google.Ads.GoogleAds.V10.Errors.GoogleAdsException HResult=0x80131500 Message=Status(StatusCode="Unauthenticated", Detail="Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",

I want to use "keywordPlanIdeaService" Can anyone have any suggestions.

I want to develop a webhook for adding leads automatically from google lead form into CRM. Google can call a webhook url to submit such leads.

Refer to the link: https://developers.google.com/google-ads/webhook/docs/overview

This link at microsoft : https://learn.microsoft.com/en-us/aspnet/webhooks/ have mentioned several nuget packages to build webhook receiver but none for google lead form.

Can any one help me to identify how can I build such webhook that can be called through google to add lead automatically into CRM.

TIA.

I am new to .net-core and docker. The problem I am going to explain here is a bit tricky, but if you have any type of questions please do ask me and I will explain it more clearly.

So, I have a docker container running on my localhost for whatsapp business api, as explained in Whatsapp Business Api Documentation.

I have already downloaded Postman Collection of Whatsapp Business Api from Whatsapp Business Postman Collection.

Everything seems to be working perfectly fine. But now I want to call these pre-built apis with .net-core and get the responses. As I couldn't find anything good, or also as a newbie it's difficult for me to understand. So for some knowledge I would like to know How can I call them and get the effective response. For example, take an example of a post request for admin login

API: {{URL}}/v1/users/login Authorization -> (Basic Auth) username: admin password: **** 
RESPONSE: {     "users": [         {             "token": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJ1c2VyIjoiYWRtaW4iLCJpYXQiOjE1NTk5MTE1NTUsImV4cCI6MTU2MDUxNjM1NSwid2E6cmFuZCI6LTQxMzgyNDE0MjYwMDI5NjA1OTl9.PYAhEilXX3GDhRo0O-M0V0aXWfL5THJkG65LfIesxh4",             "expires_after": "2019-06-14 12:45:55+00:00"         }     ],     "meta": {         "version": "v2.23.4",         "api_status": "stable"     } } 

the images for more explanation can be seen below in the request and response links.

The Login Authentication UI Image.

The Login Authentication Postman Image.

The Login Authentication Response New Password UI Image.

The Login Authentication Response Postman Image.

Now with this token I can create more users by other api calls. How can I call an api like this and get the response with token and use that token for more functionalities or api calls with .netcore.

Thank you.

I am working on (built-in web apis) provided by whatsapp business api. As a newbie in .net core razor pages and web apis. I want to know how can I get access to the body of the post request api. Take an example below for sending a message

Post: {URL}/v1/messages Request Body: "to": "", "message_type:" "message_text:" "recipient_type: "individual | group"" 

How can I make a call to the builtin api and access the body parts of it? Ofcourse, we as a developer can use postman for checking the working of api. But take this as a client and for the client we have some fields like

To: Message: 

How can take these fields and put it into the api call body and then when the user click on the send, the api call works and shows whatever we want to show the user for example a model with send successfully etc.

I am trying to use whatsapp business api for my application with twilio. I already have read the documentation of whatsapp business api. My question is, can we use twilio to send the messages to different whatsapp group based on id. For example, If I have 3 groups such as Students, Professors, Assistants and based on each different group I want to send a specific message such as Hi to Students, Hello to Professors and Hey to Assistants. What I know till now that Whatsapp differentiate everything with specific id, for instance, chat.whatsapp.com/DeUzzel9O13231

I also have worked with the twilio and whatsapp api where you can send a message from your twilio number to your whatsapp number like below

using System; using Twilio; using Twilio.Rest.Api.V2010.Account; class Program  {     static void Main(string[] args)     {         // Find your Account Sid and Token at twilio.com/console         // DANGER! This is insecure. See http://twil.io/secure         const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";         const string authToken = "your_auth_token";         TwilioClient.Init(accountSid, authToken);         var message = MessageResource.Create(             body: "Join Earth's mightiest heroes. Like Kevin Bacon.",             from: new Twilio.Types.PhoneNumber("+15017122661"),             to: new Twilio.Types.PhoneNumber("+15558675310")         );         Console.WriteLine(message.Sid);     } } 

The code above is only for sending a message to a specific number. Can I do the same thing with the groups? If yes, How? Is there any documentation for that?

Thanks.