I'm currently trying to develop an application that creates Skype meetings.
I'm leveraging the C# UCWA SDK and developing against Skype for Business online.
Meeting creation works fine if I only include people from the tenant in attendees, as soon as I include people not from the tenant in the meeting I get this error message:
{"code":"BadRequest","subcode":"ParameterValidationFailure","message":"Please check what you entered and try again.","debugInfo":{"diagnosticsCode":"2"}}
Here is my code sample
var meeting = new MyOnlineMeeting()
{
AccessLevel = AccessLevel.Everyone,
Attendees = new string[] { $"sip:{Settings.SkypeUserEmail}" }, //Adding anybody else than the service account makes it fail for now
Subject = series.Subject,
ExpirationTime = DateTime.Now.AddDays(3),
AutomaticLeaderAssignment = AutomaticLeaderAssignment.SameEnterprise,
Leaders = series.Organizers.Select(x => $"sip:{x.EmailAddress}").ToArray(),
LobbyBypassForPhoneUsers = LobbyBypassForPhoneUsers.Enabled,
PhoneUserAdmission = PhoneUserAdmission.Disabled
};
var dialIn = await client.OnlineMeetings.GetPhoneDialInInformation();
var meetings = await client.OnlineMeetings.GetMyOnlineMeetings();
var result = await meetings.Create(meeting);
Adding external users to the organizers properties works fine though.
My question is: how can I add external attendees to the meeting I'm creating? Is there anything specific around attendees?
After a few exchanges on the Microsoft Skype for Business MVP's private distribution list, it appears that attendees have to be part of the organization or otherwise the call will fail.
Submitted a Pull Request to update the latest version of the documentation
Related
I have used the following code in .Net Core to create a Stripe checkout session, it seems to work fine for one customer buying one subscription.
I have a scenario though where a customer would be paying for subscriptions for other people, so may well use the checkout portal multiple times. When this happens Stripe will add the customer email address as a new customer each time, so rather than have one customer who can log in to the customer portal and see all subscriptions they have paid for, they can only log in to the 1st occurance of the customer with that email address.
Is there a way to use the checkout session so that if a customer email already exists it is not added again as a new customer?
var options = new SessionCreateOptions
{
SuccessUrl = successUrl+"&email=" + email,
CancelUrl = cancelUrl,
Mode = "subscription",
AllowPromotionCodes = true,
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
Price = priceId,
Quantity = 1,
},
}
};
var service = new SessionService(this.client);
try
{
var session = await service.CreateAsync(options);
Response.Headers.Add("Location", session.Url);
return new StatusCodeResult(303);
}
Checkout does not automatically de-duplicate customers for you. How your customer records are managed is up to you.
If you want to have a Checkout session associated with an existing customer, you need to provide that customer id when you create the session.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
My goal is simple.
I want to send an automated chat message in to a MS Teams channel using the graph API.
This seems to be beta feature of the graph API and is only avalible in the Microsoft.Graph.Beta.
I have read the docs and have been trying to follow this example:
https://learn.microsoft.com/en-us/graph/api/channel-post-messages, I have all the permissions set correct in my azure portal. I keep getting 'Unknown Error' I have tried:
var graphServiceClient = MicrosoftGraphService.GetGraphServiceClient();
var chatMessage = new ChatMessage
{
Subject = null,
Body = new ItemBody
{
ContentType = BodyType.Text,
Content = messageText
}
};
var response = await graphServiceClient.Teams["77f9c17f-54ca-4275-82d4-fff7esdacda1"].Channels["2007765c-8185-4cc7-8064-fb1b10f27e6b"].Messages.Request()
.AddAsync(chatMessage);
I have also tried to to see if I can get anything from teams:
var teams = await graphServiceClient.Teams["77f9c17f-54ca-4275-2sed4-ffsde59acda1"].Request().GetAsync();
Again all I get is Unknown error, I have used GRAPH API before to do things like get users in an organisation, so I know the genreal set up is correct.
Has anyone on the Internet somewhere in the world got this to work?! becuase its driving me crazy
Same problem here :
Everything is ok with users or groups, but I can't get anything from Teams (unknownError)
All IDs are correct and checked
Here are the authorizations I have set for the app :
Read all users' teamwork activity feed
Read all groups
Send a teamwork activity to any user
Get a list of all teams
Here is my code (based on microsoft daemon app scenario)
The access token is ok
var graphClient = new GraphServiceClient(
"https://graph.microsoft.com/beta",
new DelegateAuthenticationProvider(async (requestMessage) =>
{
requestMessage.Headers.Authorization =
new AuthenticationHeaderValue("Bearer", result.AccessToken);
}));
var chatMessage = new ChatMessage
{
Subject = "Message de test",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Contenu de test"
}
};
await graphClient.Teams["218a4b1d-84d5-48a2-97a0-023e4e4c3e85"].Channels["19:adbf8ddf37a049aa9f63a0f8ee0e8054#thread.tacv2"].Messages
.Request()
.AddAsync(chatMessage);
And the result :
Token acquired
Code: UnknownError
Inner error:
AdditionalData:
request-id: e2e433d8-cedd-4401-b5b2-6f34cf5611cf
date: 2020-03-30T12:14:15
ClientRequestId: e2e433d8-cedd-4401-b5b2-6f34cf5611cf
Edit(2020-04-01) :
No solution at the time being : there are answers to comments at the bottom of the page "Create chatMessage in a channel" in ms doc (feedback section)
It seems that applications cannot be granted the permission to send chatMessages up to now.
RamjotSingh commented on Jun 11, 2019 Contributor
#pythonpsycho1337 - As the permission table above notes, Application
only context is not supported on this API at the moment.
RamjotSingh commented on Dec 16, 2019 Contributor
Supporting application permissions is something we plan to do but we do not have a date yet.
RamjotSingh commented a day ago Contributor
We will share on Microsoft Graph Blog once we have application
permissions for this API. Since the original question for this issue
was answered. Closing it.
I am getting a forbidden (403) when trying to add an event to my calendar (API v3 & OAuth2), as follows:
var service = CalendarService();
CalendarListResource.ListRequest request = service.CalendarList.List();
IList<CalendarListEntry> calendarList = request.Execute().Items;
foreach (CalendarListEntry entry in calendarList)
{
Console.WriteLine(
"Summary:{0}\nLocation:{1}\nTimeZone:{2}",
entry.Summary, entry.Location, entry.TimeZone
);
}
var startDate = DateTime.Now.AddDays(1);
var endDate = startDate.AddDays(1);
var eventBody = new Google.Apis.Calendar.v3.Data.Event
{
Description = "Test 4 description",
Summary = "Test 4 summary",
Start = new EventDateTime
{
DateTime = startDate
},
End = new EventDateTime
{
DateTime = endDate
}
};
var insertRequest = service.Events.Insert(calendarId: calendarId_emailAddress, body: eventBody); //InsertRequest
insertRequest.Execute();
I have set up oauth2 service account, granted scopes, and shared the calendar. However, something I noticed on the calendar share part is that I am unable (no option available) to share for read/write. Only option is "freeBusyRead".
EDIT:
Let me add that calendarId_emailAddress = "my_email_address". I was able to add an event. No errors. And then iterate and find it. But it does not show up in my calendar. I seem to not be making the connection between the calendarId and the "actual calendar" in my user panel.
So how to do this. Any help appreciated. Thanks.
Your Google Apps domain probably limits the level of sharing to external accounts to free/busy only. Service accounts, even when created by a domain user, are always considered external to the domain.
The proper way to do this would be to authorize the service account to act on behalf of your domain users and then, authenticating as the service account and acting on behalf of the user, add the event to the user calendar. Domain-wide delegation of authority is discussed in the Drive API docs but can easily be applied to Calendar API also.
The trouble was in the authentication of the service. Scenarios...
1) ServiceAccountCredential with no user set, and calendarId = "primary" yields an entry into calendar. Which calendar? Who knows. I can't see the entry in my interface of that user, but I do find the entry in the Events.List("primary")
2) ServiceAccountCredential with user set to email of target calendar, and calendarId = "primary" yields an entry into calendar, which I do see in my interface of that user, and also find the entry in the Events.List("primary")
Scenario #1 really baffles me. No idea how to see that event in the calendar.
Any insight into this would be helpful. Thanks!
I tried to use the google apps reseller api with google apps script. To use oauth I need the AuthServiceName. what is the right name? "apps" does not work.
AuthServiceName is defined in your application, its not dependent on the API that you are connecting to, i would suspect that you may not have completed all the steps necessary or that your oauth call is not properly structured.
Here is an example of a call that retrieves the details of domains.
function getCustomer() {
//set up oauth for Google Reseller API
var oAuthConfig1 = UrlFetchApp.addOAuthService("doesNotMatter");
oAuthConfig1.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope=https://www.googleapis.com/auth/apps.order.readonly");
oAuthConfig1.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
oAuthConfig1.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken?oauth_callback=https://script.google.com/a/macros");
oAuthConfig1.setConsumerKey(CONSUMER_KEY);
oAuthConfig1.setConsumerSecret(CONSUMER_SECRET);
var options1 = {oAuthServiceName:"doesNotMatter", oAuthUseToken:"always",
method:"GET", headers:{"GData-Version":"3.0"}, contentType:"application/x-www-form-urlencoded"};
//set up user profiles url
var theUrl = "https://www.googleapis.com/apps/reseller/v1/customers/somedomain.com";
//urlFetch for customer list
var customerInfo = "";
try {
var response = UrlFetchApp.fetch(theUrl,options1);
customerInfo = response.getContentText();
} catch(problem) {
Logger.log(problem.message);
}
Logger.log(customerInfo);
}
This will work if
You have a reseller account (I guess i.e. I did not test on my non reseller account)
You have create a project in the API console, and enabled the Reseller API
You know your SECRET and KEY lifted form the console
I have use a read.only scope which is safe, if not you need to set up your tests in the sand box
Let me know if you need any more clarifications
I am integrating the Carrier (USPS, UPS, DHL, FeDex) API with my application.
For that i need to find different statuses for that shipment like is it delivered or not, which is getting me properly.
Similarly, i need to check whether the shipment required the signature or not?
How do i came to know this using the different API?
Regards,
Salil Gaikwad
Not all APIs support the same functionality. All will tell you the current status and some will provide the shipper/recipient information but I don't believe any will tell you if it was sent signature required.
E.g. for FedEx if you want to know about parcel's tracking events (delivered or not, any problems, delivery time and many other info) use this service endpoint - https://ws.fedex.com:443/web-services/track. The request to FedEx will be look like this (C# sample):
TrackRequest request = new TrackRequest();
request.WebAuthenticationDetail = new WebAuthenticationDetail();
request.WebAuthenticationDetail.UserCredential = new WebAuthenticationCredential()
{
Key = "ApiKey",
Password = "PasswordKey"
};
request.ClientDetail = new ClientDetail
{
AccountNumber = "...",
MeterNumber = "..."
};
request.TransactionDetail = new TransactionDetail();
request.PackageIdentifier = new TrackPackageIdentifier();
request.PackageIdentifier.Value = "parcel tracking number";
request.PackageIdentifier.Type = TrackIdentifierType.TRACKING_NUMBER_OR_DOORTAG;
request.IncludeDetailedScans = true;
request.IncludeDetailedScansSpecified = true;
request.Version = new VersionId();
When you receive from FedEx - TrackReply, you should check TrackDetails array. There will be tracking info. As for other carriers, the common idea is the same. Almost every carrier use tracking number.