api
89 Topicsđ¤Â How to integrate ChatGPT in Power Platform [OpenAI,PowerApps,Power Automate]
NEW VIDEO N. 338 OpenAI is an American artificial intelligence research laboratory which provides several AI services, just to mention the most popular ChatGPT. In this video I'll show you how Microsoft is collaborating with OpenAI to bring the power of AI in Power Automate. Moreover I'll show you how to implement ChatGPT in Power Platform.9KViews0likes0Commentsconnect-pnpmicrosoftgraph Has Been Deprecated
I have a script that creates an Office 365 group and the associated SharePoint site using PnP PowerShell. I recently updated the SharePointPnPPowerShell assemblies to version 2.20.1711.0. Now I'm getting a warning that connect-pnpmicrosoftgraph has been deprecated and will be removed in April 2018. I have found that connect-pnponline is it's replacement but I'm having trouble connecting. For connect-pnpmicrosoftgraph, I'm using $conn = connect-pnpmicrosoftgraph -AppId $appid -AppSecret $client_secret -AADDomain "mydomain.onmicrosoft.com" -Verbose; When I look at the details of Connect-PnPOnline with Microsoft Graph using Azure Active Directory, I see the same parameters, but running this throws an error connect-pnponline : Value cannot be null. Parameter name: uriString At line:1 char:9 + $conn = connect-pnponline -AppId $appid -AppSecret $client_secret -AA ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], ArgumentNullException + FullyQualifiedErrorId : System.ArgumentNullException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline Upon further investigation, it appears that AADDomain is incorrect and that I should be using url. But I'm at a loss as to what I'm supposed to use here. I've tried mydomain.onmicrosoft.com, but get an error Connect-PnPOnline : Invalid URI: The format of the URI could not be determined. At line:1 char:1 + Connect-PnPOnline -url "mydomain.onmicrosoft.com" -AppId "xxxxxxx-xxx ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], UriFormatException + FullyQualifiedErrorId : System.UriFormatException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline So I tried https://mydomain.onmicrosoft.com, but get this error Connect-PnPOnline : Token request failed. At line:1 char:1 + Connect-PnPOnline -url "https://mydomain.onmicrosoft.com" -AppId "xxxx ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], RequestFailedException + FullyQualifiedErrorId : Microsoft.IdentityModel.SecurityTokenService.RequestFailedException,SharePointPnP.PowerShell.Commands.Base.Conne ctOnline Same when I use https://graph.microsoft.com, and https://mydomain-admin.sharepoint.com Using https://mydomain.sharepoint.com gives me a 403 forbidden error. What is the correct replacement URL for connect-pnpmicrosoftgraph?Solved8.1KViews1like10CommentsMicrosoft Graph API - Lots of 504 GATEWAY TIMEOUT ERROR
Hello, I am using Microsoft Graph api to fetch and delete emails from Outlook mailboxes. To be more specific, there is a service which runs every 5 minutes to fetch 100 emails, their attachments and then delete them from 6 different mailboxes. But I get a lot of 504 GATEWAYTIMEOUT errors. Is there any way to fix it? For example: Status Code : GatewayTimeout. Error response { "error": { "code": "UnknownError", "message": "", "innerError": { "date": "2020-10-06T06:10:37", "request-id": "e7ac5888-4d38-407a-95af-496de867653a", "client-request-id": "e7ac5888-4d38-407a-95af-496de867653a" } } } Any help immediately would be appreciable. Thank you !7KViews0likes1CommentCan't access shared mailbox through API even after granting permissions
Hi, As the title said, I am unable to access a shared mailbox using Graph API 1.0 even after granting the right permissions. I want to know what I'm missing here. The user can see its own emails, but calling the shared mailbox results in this error: Access to OData is disabled. 1) We have setup the following permissions, as of yesterday. Calendars.ReadWrite Mail.Read Mail.Read.Shared Mail.ReadWrite Mail.ReadWrite.Shared Mail.Send Mail.Send.Share 2) Those permissions are given to all the members of our AD group. The shared mailboxes were not part of this AD group at first, but we also added them to the security group today, with no difference in the outcome. 3) This is the URL we're calling https://graph.microsoft.com/v1.0/users/email address removed for privacy reasons/mailFolders (any other endpoint gives the same result) but this one works and returns the user's own emails: https://graph.microsoft.com/v1.0/users/email address removed for privacy reasons/mailFolders 4) I am able to see the shared mailbox in the Outlook desktop app and on office 365 online app as well. What are we missing? *edit: this forum automatically removed the fake email addresses I wrote for understanding so I put them back.6.9KViews0likes1CommentPermissions in Dynamics 365 CRM Web API
Hi all, Looking for some help in gaining access to data in the Dynamics 365 CRM Web API. I have read so much documentation, and I still can't figure it out. This is a server-to-server app. I created it in my Azure account/tenant, but it needs access to the Web API in (multiple) other tenant accounts. So far, I have registered an app in Azure AD. For the API permissions, I have added Dynamics CRM (user_impersonation). I sent an Oauth authorization request, and it has been approved by the client. Example: https://login.microsoftonline.com/<client's_tenant_id>/oauth2/authorize?... After exchanging the auth code for an access token, I AM able to access the Web API resources. Example: GET https://domain.api.crm.dynamics.com/api/data/v9.1/contacts. BUT, my permissions are only for user impersonation. So, my Oauth token request does not provide a refresh token, and the scope is limited to user_impersonation. On the API Permissions screen, I can only add "Delegated permissions", and user_impersonation is the only option. I would have hoped to add "Application permissions". If that's not what I need, what am I missing? How do I get application-level permission to the Web API, with a refresh token? Thanks6.3KViews0likes0CommentsDetails about Office 365 Service Communications API
Hi experts, I would like to know the details about Office 365 Service Communications API. Q1. SCOPE of Office 365 Service Communications API service health My understanding is that we can check the status of services such as Exchange Online and SharePoint Online "IN THE TENANT" in Office 365 Service Communications API? Is this correct? Q2. What kind of service health status does Office 365 Service Communications API have? I know that Admin Portal has the status such as Investigating, Service degradation, Service interruption, Restoring service, Extended recovery, Investigation suspended, Service restored and Post-incident report published, but I don't know the case of Office 365 Service Communications API. Q3. Can we check the service health status of Azure AD in Office 365 Service Communications API? Q4. Can we also check the service health status of "Features" included in Service in Office 365 Service Communications API? Can you share the definition and meaning as follows? Features in Exchange Online Sign-inăE-Mail and calendar accessăE-Mail timely deliveryăManagement and ProvisioningăVoice mail Features in SharePoint Online ProvisioningăSharePoint FeaturesăTenant AdminăSearch and DelveăCustom Solutions and Workflowsă Project OnlineăOffice Web AppsăSP DesignerăAccess ServicesăInfoPath OnlineSolved6.3KViews0likes4CommentsUse Outlook REST API to send email failed when using App-only token.
I am trying to use outlook REST API to send email by using app-only token and got the following exception. "x-ms-diagnostics: 2000008;reason="The token contains no permissions, or permissions can not be understood.";error_category="invalid_grant"" the following steps is the one I did create a Azure AD app to update "keyCredentials" section for certificate informaiton in manifest file. configure "O365 exchange online" to have "send email as any user" for "Application Permissions" run the following code: private async static Task SendEamil() { //string tenantId = "yourtenant.onmicrosoft.com"; //string clientId = "your client id"; //string resourceId = "https://outlook.office.com/"; //string resourceUrl = "https://outlook.office.com/api/v2.0/users/service@contoso.com/sendmail"; //this is your on-behalf user's UPN //string authority = String.Format("https://login.windows.net/{0}", tenantId); //string certficatePath = @"c:\test.pfx"; //this is your certficate location. //string certificatePassword = "xxxx"; // this is your certificate password //read Azure Ad setting from a file. string settingJson = String.Format("{0}\\setting.settingjson", AppDomain.CurrentDomain.BaseDirectory); AzureAdSetting setting = AzureAdSetting.CreateInstance(settingJson); var itemPayload = new { Message = new { Subject = "Test email", Body = new { ContentType = "Text", Content = "this is test email." }, ToRecipients = new[] { new { EmailAddress = new { Address = setting.SendEmail } } } } }; //if you need to load from certficate store, use different constructors. X509Certificate2 certificate = new X509Certificate2(setting.CertficatePath, setting.CertificatePassword, X509KeyStorageFlags.MachineKeySet); AuthenticationContext authenticationContext = new AuthenticationContext(setting.Authority, true); ClientAssertionCertificate cac = new ClientAssertionCertificate(setting.ClientId, certificate); //get the access token to Outlook using the ClientAssertionCertificate var authenticationResult = await authenticationContext.AcquireTokenAsync(setting.ResourceId, cac); string token = authenticationResult.AccessToken; //initialize HttpClient for REST call HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token); client.DefaultRequestHeaders.Add("Accept", "application/json"); //setup the client post HttpContent content = new StringContent(JsonConvert.SerializeObject(itemPayload)); //Specify the content type. content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json;odata=verbose"); HttpResponseMessage result = await client.PostAsync(setting.ResourceUrl, content); if (result.IsSuccessStatusCode) { //email send successfully. Console.WriteLine("Email sent successfully. "); } else { //email send failed. check the result for detail information from REST api. Console.WriteLine("Email sent failed. Error: {0}", await result.Content.ReadAsStringAsync()); } } The weird thing I found out was that I tried above steps and code in my personal O365 tenant and it works. Just wondering if anyone know any configures we need to turn on in O365 central admin to allow Outlook REST API access via app-only token.Solved6KViews0likes3CommentsMicrosoft Graph PowerShell SDK Module OneDrive Folder Permissions Assignment
As an M365 Global Admin, I have been tasked with creating a new folder in other users OneDrive root folder (Documents) we can call that folder 'myFolder', then I need to assign a Microsoft Azure Security group ('myGroup') to that folder with read/write permissions. I have a list of users (taking input from txt file of UPNs), and am able to loop through the users and create the folder, so step one is possible, but where I am failing is the assignment of the permissions, am using PowerShell 7 and the MS Graph PowerShell Mod, actually for the folder creation I used the API and invoke-method, but I am running into problems since OneDrive is on top of SharePoint, I am not sure how to accomplish this task. Any help would be greatly appreciated!Solved5.9KViews0likes11CommentsOutlook Mail API: Error 429 after 500 message 'move' requests
We often receive an error 429 when using the Microsoft Graph or Outlook Mail REST API for particular actions on one mailbox. Error 429 seems to be a Throtting issue, but we cannot find any information about the issue we experience, because it's not related to the 'Rate-Limit' throttling rule documented here: https://blogs.msdn.microsoft.com/exchangedev/2017/04/07/throttling-coming-to-outlook-api-and-microsoft-graph/. We are now able to reproduce this with the following step below: (we used direct Outlook Mail API to reproduce it) Get number of items in the Inbox Get subfolders of the Inbox Read first 10 e-mails sorted by âreceived dateâ For each email, move the e-mail to the âprocessedboxâ (which is a subfolder of the Inbox). At exactly 500 âmoveâ actions we see the following behavior of the API: After 500 move actions: Error 500: code=ErrorMoveCopyFailed message=The move or copy operation failed. The next âmoveâ-action Error 429 code=ErrorTooManyObjectsOpened message=Too many concurrent connections opened., The process failed to get the correct properties. Important to mention here is that the other 3 request (Get number of items, get subfolders and read first 10 e-mails) are still working after this and return the correct data. Only on the move action we receive an error 429. We tried several mailboxes (shared and user mailboxes), same issue. Itâs not the âRate Limitâ-throttling, because the header returns the information below and there are still remaining requests, when the error 500 occurs: Rate-Limit-Limit: 10000 Rate-Limit-Remaining: 9502 Rate-Limit-Reset: 2018-01-12T15:30:26.817Z We currently cannot find any Throttling documentation related to the 500 move actions. We sometimes have to wait for more than 30 minutes before the 429 error disappears. Is this a bug in the API? Or a throttling rule/issue? Anyone experiencing the same?5.4KViews0likes2Comments"Token type is not allowed" error on sharepoint search API
Aim:- To access sharepoint through REST Api Steps taken:- Created site on sharepoint. Registered site as an app using https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbhyve10.sharepoint.com%2Fsites%2FTech%2F_layouts%2F15%2Fappregnew.aspx&data=04%7C01%7Co365sup8%40microsoft.com%7Cbfe06b253de34885950a08d9e23b8f0d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637789568299728568%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WY%2BGE1%2FpQurUMOeVsdfvW3F3mnWfIjcaCUOmNkWknSU%3D&reserved=0 Granted tenant scope permission using https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbhyve10.sharepoint.com%2Fsites%2FTech%2F_layouts%2F15%2Fappregnew.aspx&data=04%7C01%7Co365sup8%40microsoft.com%7Cbfe06b253de34885950a08d9e23b8f0d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637789568299728568%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WY%2BGE1%2FpQurUMOeVsdfvW3F3mnWfIjcaCUOmNkWknSU%3D&reserved=0 Permission xml used <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" /> </AppPermissionRequests> 4. Collected app identifier from https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbhyve10.sharepoint.com%2Fsites%2FTech%2F_layouts%2F15%2Fappregnew.aspx&data=04%7C01%7Co365sup8%40microsoft.com%7Cbfe06b253de34885950a08d9e23b8f0d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637789568299728568%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WY%2BGE1%2FpQurUMOeVsdfvW3F3mnWfIjcaCUOmNkWknSU%3D&reserved=0 5. Fetched access token using https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Faccounts.accesscontrol.windows.net%2F%253C%253C%253E%253E%2Ftokens%2FOAuth%2F2%2F&data=04%7C01%7Co365sup8%40microsoft.com%7Cbfe06b253de34885950a08d9e23b8f0d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637789568299728568%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tCjKyunrE4H9LbphNC0sQYV7YS0yLn24muvgfEL6U%2BE%3D&reserved=0 6. Tried to search using https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbhyve10.sharepoint.com%2Fsites%2FTech%2F_api%2Fsearch%2Fquery%3Fquerytext%3D%27smart%27&data=04%7C01%7Co365sup8%40microsoft.com%7Cbfe06b253de34885950a08d9e23b8f0d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637789568299728568%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Q0bcbQ660duts0ylYkBfE5GlCBUYtpEQKFWD61V8QvE%3D&reserved=0 Headers Content-Type:application/json;odata=verbose Accept:application/json;odata=verbose Authorization:Bearer <<access token from step 5>> Got below error message {"error":"invalid_request","error_description":"Token type is not allowed."}5.1KViews0likes3Comments