Make a DeepLink url call for group chat - c#

I'm working on a Adaptive card in bot framework v3 using c#. On my Adaptive card I have created a AdaptiveShowCard action. In that show card I have binded a choice options which has a value of user email ID. On click of submit of that show card I have to initiate a group chat.
Problem: when submit button is clicked, I'm getting the values of email id's in Activity object, now i have to use that Id's and create a deeplink URL
Challenge: I'm unable to make a Deeplink url call from my message controller.
Code adaptiveshowcard:
new AdaptiveShowCardAction()
{
Title = "Group chat",
Card = Groupchat // having choice structure
},
Message controller:
if (activity.Name == "composeExtension/onCardButtonClicked")
{
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
HttpWebRequest request = WebRequest.Create("https://teams.microsoft.com/l/chat/0/0?users=User#domain.onmicrosoft.com") as HttpWebRequest;
}
}
Please suggest how to initiate a group chat

Related

Invite email do not sent to non google account when sharing a calendar

C# package used: Google.Apis.Calendar.v3
I am making a sharing a calendar to an not google account.
No invite notification sent to that account event the Response = OK
var rule = new AclRule
{
Role = "owner",
Scope = new AclRule.ScopeData
{
Value = acb#yahoo.com,
Type = "user"
}
};
var service = await GetCalendarService();
var request = service.Acl.Insert(rule, calendarId);
request.SendNotifications = true;
AclRule addedRule = await request.ExecuteAsync();
So could anybody help me about that?
Thanks,
I found that google calendar API dont have any options to send notification to non google email.
Moreover, the calendar must be made as public first. This one can not modify by API. And I dont want to make it as public also.
Here's document from google

Getting the URL of the origin / referrer for user registration

I have a piece of code that I've tested for a simple user registration code:
ReferrerURL = Request.UrlReferrer.AbsoluteUri
This property is set for user when he registers onto the website.
For example if user clicked onto the site via some ad, I'd like to get the origin site from where he came from.
With this piece of code I'm only getting the URL of my own site which looks like:
example.com/Registration
Regardless where the user came from... Is there any other way to fetch that information from where the user originally came (if it is available) - if not then just simply leave this field as null...
[ValidateAntiForgeryToken]
public async Task<ActionResult> DoRegister(UserRegistrationViewModel model)
{
var user = new Users()
{
FirstName = model.FirstName,
LastName = model.LastName,
Email = model.Email,
CountryId = 230,
Active = false,
PasswordSalt = salt,
PasswordHash = PasswordHelper.CreatePasswordHash(model.Password, salt),
GUID = _guid,
HasSpecialSubscription = false,
TotalScans = 0,
IsFreeTrialExpired = false,
DateOfRegistration = DateTime.Now,
ReferrerId = referrerId,
AffiliatePct = 0.15,
Cycles = 3,
ReferrerURL = Request.UrlReferrer.AbsoluteUri
};
}
A referrer is a header sent by browsers when the user navigates to another page, so the target site knows the originating site - if a browser is configured to send it (privacy settings or plugins may strip the header) and if the sites use the same scheme (referrers aren't sent when transferring from http to https or vice versa).
But every click resets the referrer to the current page. So if your users flow like this:
External Site -> Registration Page -> Registration POST Handler
Then in the last one, the referrer will be your registration page, not the external site's address.
So you need to save the referrer in the registration page, and forward it to your POST action. You could do so in a hidden form field, or by storing it in the session, or in a cookie. All approaches have their pros and cons.

How to pass PayPal send invoice reminder value using c#..? (PayPal Invoicing API)

I'm integrating PayPal Send Invoice Reminder through PayPal Invoicing API.
Here is my code,
sandbox url
var sandbox = "https://api.sandbox.paypal.com/v1/invoicing/invoices/";
notification object,
var notification = new Notification
{
subject = "Payment Reminder",
note = "This is a reminder that payment is due on " + InvoiceDueDate,
send_to_merchant = true
};
Invoice Id and Generated Access Token,
var invoice_id = "your invoice id";
var access_token = "your generated access token";
PayPal Send Reminder Api needed above values for Send Reminder Task but how to get response using above values and also how to pass these values(parameters) to rest API of PayPal.
Thanks, Kaushik.
Send Reminder PayPal Example:

PayPal Adaptive Payments - retrieving sender's billing address via IPN / API?

I'm using the Adaptive Payments API to redirect the user from my web-site to a PayPal page to finish the payment. I've hooked this up with a 3rd party Invoicing service which listens via IPN.
For some reason, the Billing Address does not appear in the IPN data, and so does not appear on the invoice. Is there any flag I need to pass to the Adaptive Payments API to tell it to pass along the Billing Address?
Here's how I'm currently using the API:
var receiverList = new ReceiverList
{
receiver = new List<Receiver>
{
new Receiver(purchase.TotalPrice)
{
email = _configurationReader.GetStringValue("PayPalEmail")
}
},
};
var envelope = new RequestEnvelope("en_US");
var payRequest = new PayRequest(envelope, ActionType.Pay.GetApiString(), cancelUrl, CurrencyCode.USDollar.GetApiString(), receiverList, returnUrl);
var service = new AdaptivePaymentsService();
var response = service.Pay(payRequest);
purchase.PayPalPaymentId = response.payKey;
return CreatePayPalRedirectUrl(response);
PayPal does not send billing addresses to sellers. That's one of the advantages for buyers using the system...they don't have to share any billing info with all the different sellers they buy from.
The only address you would ever get from PayPal (in an API response, IPN notification, etc.) would be a shipping address, and that would only be provided if included in the original transaction.

Facebook C# SDK - Mobile Web Page : Facebook Wall Post URL Redirect

I am currently working on a mobile web page in asp.Net MVC2 that allows users to post to their walls. I have the following code that posts to the user's wall, but would like to instead have a redirect to Facebook's mobile "Post To my Wall" view to allow the user to add to the posted message and submit with a "Post" button or "Cancel". Do I have to recreate this view myself? It seems like something that a lot of sites would use.
public string PostToWall(string code)
{
string authToken = string.Empty;
try
{
authToken = GetAuthToken(code);
FacebookClient app = new FacebookClient(authToken);
dynamic user = app.Get("me");
var id = user.id;
var args = new Dictionary<string, object>();
args["message"] = "Test Wall Post";
args["caption"] = "Test Caption";
args["description"] = "Test Description";
args["name"] = "Test Name";
//args["picture"] = "[your image URL]";
//args["link"] = "[your link URL]";
app.Post("/me/feed", args);
return string.Empty;
}
catch (Exception ex)
{
_log.ErrorFormat("Error getting the Facebook authentication token. {0}", ex);
return string.Empty;
}
}
Thanks!
[Edit] #OffBySome I set up a rough test using the facebook Javascript SDK and I set it to display: 'touch' but it still pops up in my safari iphone user agent. I used this
attachment: {
title: '<my title>',
caption: '<my caption>',
description: (
<my description>
),
name: '<name>',
link: '<link>',
display: 'touch', },
But none of these attachments get added to my wall posts. Am I doing it wrong? Dialogs: Fb.Ui http://developers.facebook.com/docs/reference/javascript/#xfbml
Easiest for this would be to use the Facebook javascript sdk and use the FB.ui dialog to allow the user to share. You can set display=touch or display=wap for a mobile optimized dialog.

Categories