developer
113 TopicsGetting delta change for files from team and its channels
We are processing delta changes from onedrive data and teams data. We are using delta api so if someone share the current file with any user we got the file details in delta api for onedrive item. But in case of teams and channle data it won't. So is there any way to get delta for the files from team if shared with some othe user or team. We also want api to know files shared with team as we are also fetching data shared with user by using insight api10Views0likes0CommentsAuthentication issue while using Client Credential through Oauth2.0
Hi Community Hope you are doing well. I am unable to authenticate to our registered app in azure. I am looking to test the get/users graph api using insomnia (similar tool as postman). During Token generation we are getting 401 error. we are provide correct Client ID and Secret with right scope url. I created the app, added the necessary permissions and the client credentials. Do I need to add a redirect uri to the app? Does the app need to be registered account types as "accounts in any organization directory"? I am getting a 401 unauthorized error Can you please assist what I'm what is missing here? I will really do appreciate your help. Thanks Vatan32Views0likes1CommentError getting new token
Hi, i want to add a new member to a private channel. I follow the authentication flow as follows: a) starting with url https://login.microsoftonline.com/#tenantid#/oauth2/v2.0/authorize?client_id=#clientid#&response_type=code&response_mode=query&redirect_uri=https://www.dashandwerk.net/dashandwerk/api/graph/webhook&scope=offline_access%20TeamMember.ReadWrite.All%20ChannelMember.ReadWrite.All%20User.Read&state=1234" b) my redirect_uri will open and i am getting a new code c) this new code will be used to get a new token with this url https://login.microsoftonline.com/#tenant#/oauth2/v2.0/token?client_id=#client_id# &client_secret=#client_secret# &scope=offline_access%20TeamMember.ReadWrite.All,ChannelMessage.Send%20User.Read%20Mail.Read%20ChannelMember.ReadWrite.All' &code=#code# &redirect_uri=https://www.dashandwerk.net/dashandwerk/api/graph/webhook &grant_type=authorization_code But when getting the new token, i am getting this error: "{"error":"invalid_grant","error_description":"AADSTS65001: The user or administrator has not consented to use the application with ID '640a5194-77b1-40cf-b774-fc9eb9a6d128' named 'dashandwerk-teams'. Send an interactive authorization request for this user and resource. Trace ID: 34a8ea64-b664-448c-9b7c-b4c9a92e0300 Correlation ID: 77e80082-9e58-4da9-8752-2d7bc75d7262 Timestamp: 2025-03-03 11:11:08Z","error_codes":[65001],"timestamp":"2025-03-03 11:11:08Z","trace_id":"34a8ea64-b664-448c-9b7c-b4c9a92e0300","correlation_id":"77e80082-9e58-4da9-8752-2d7bc75d7262","suberror":"consent_required"} Searching on google shows this: Make sure you have followed the steps to grant admin consent. You can do this under Application > API permissions > Grant admin consent. But all grants have admin consent in the office admin center for intra at the app registration. Any ideas to solve this issue ?16Views0likes1CommentStatus code keep changing after every query (404 & 200)
I am using the graph api to get the folders under my OneDrive root directory but the result is different in every run (most of the time failing). I have given it the Files.Read and Files.ReadWrite permission. This happened after I changed my microsoft password, but changing it again doesn't fix the issue. The query: https://graph.microsoft.com/v1.0/me/drive/root/children?%24select=name%2C%20id The screen recording: https://youtu.be/NIaz0Q37osg Timestamp: 0:00 - 0:13: 404 Not found error 0:16 - 0:26: 200 Files are found correctly 0:27 - 0:32: 404 Not found error again, without changing the query18Views0likes0Commentsget SharePoint site items ID
I'm trying to extract all SharePoint News articles from my tenant. I'm almost there but struggling with the last step. My initial graph call is this; It returns all the news posts in a site https://graph.microsoft.com/beta/sites/{SiteID}/pages/microsoft.graph.sitePage?$filter=createdDateTime gt 2025-01-01T00:00:00.0000000Z and promotionKind eq 'newsPost' but there is no way of identifying if a post is published from that call, So I need to do a second call https://graph.microsoft.com/v1.0/sites/{SiteID}/lists/{ListID}/items/{ItemID}/?expand=fields($select=*,FirstPublishedDate) this expands a field 'FirstPublishedDate'. If it doesn't exist, the article has never been published. My problem is I dont get the {ItemID} from the first call. this is the Id visible in the sharepoint list, e.g. 1,2,3 etc. not a GUID. the output of my first graph call looks like this. How can I get the list item ID? "value": [ { "@odata.etag": "\"{404E5AC9-E35D-4895-8E89-E10BBA93B522},25\"", "createdDateTime": "2024-12-16T15:37:08Z", "description": "Hello everyone…", "eTag": "\"{404E5AC9-E35D-4895-8E89-E10BBA93B522},25\"", "id": "404e5ac9-e35d-4895-8e89-e10bba93b522", "lastModifiedDateTime": "2024-12-16T15:43:50Z", "name": "News-Article(4).aspx", "webUrl": "https://company.sharepoint.com/functions/comms/SitePages/News-Article(4).aspx", "title": "Merry Christmas - A message from ", "pageLayout": "article", "promotionKind": "newsPost", "showComments": true,26Views0likes0CommentsFacing issue for Outlook calendar Sync with PHP
When using Microsoft Graph Explorer, and making request, it’s returning the events data correctly. But when in code we generate access token, it’s not able to make request and there is some permission issue, So, the access token we are generating through code as per the official Microsoft documentation, isn’t having the required permission, even though we are specifying the required permission array as scope when making request for access token. Below is the code, I am using public function authorize() { $auth_url = $this->Microsoft_calendar_model->createAuthUrl(); redirect($auth_url); } public function createAuthUrl() { $authorize_url = "{$this->auth_base_url}/{$this->tenant_id}/oauth2/v2.0/authorize"; $queryParams = http_build_query([ 'client_id' => $this->client_id, 'response_type' => 'code', 'redirect_uri' => $this->redirect_uri, 'scope' => implode(' ', $this->scopes), 'response_mode' => 'query', 'prompt' => 'consent' ]); return "{$authorize_url}?{$queryParams}"; } // User is getting prompt for permission consent and even though accepting all permissions isn't working public function callback() { $code = $this->input->get('code'); // I am getting the code here. $access_token = $this->microsoft_calendar_model->fetchAccessTokenWithAuthCode($code); } Issue occurs in the below function public function fetchAccessTokenWithAuthCode($code) { $token_url = "{$this->auth_base_url}/{$this->tenant_id}/oauth2/v2.0/token"; $client = new \GuzzleHttp\Client(); $response = $client->post($token_url, [ 'headers' => [ 'Content-Type' => 'application/x-www-form-urlencoded' ], 'form_params' => [ 'client_id' => $this->client_id, 'client_secret' => $this->client_secret_value, 'redirect_uri' => $this->redirect_uri, 'code' => $code, 'grant_type' => 'authorization_code', 'scope' => 'offline_access Calendars.ReadWrite' ] ]); $tokenData = json_decode($response->getBody()->getContents(), true); $tokenContext = new AuthorizationCodeContext( $this->tenant_id, $this->client_id, $this->client_secret_value, $tokenData['access_token'], $this->redirect_uri ); $graphClient = new GraphServiceClient($tokenContext, $this->scopes); $events = $graphClient->me()->calendars()->byCalendarId('primary')->events()->get()->wait(); pre($events); } What I'm doing wrong, I can't figure it out anywhere?45Views0likes0CommentsProblem when sending out the invitation
I'm facing an issue where the invitation isn't being sent to the recipient, even though the API request runs successfully. I followed the tutorial in the link below, but the response I received is slightly different. https://learn.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-beta&tabs=http It has the Invitation in the return response My response result doesn't have the invitation. As result I did no receive any invitation email. Anyone can help me this?49Views0likes0CommentsPull out events from a calendar
Good morning, For a project I would have to pull out all the events from the different meeting rooms and integrate them into an HTML. However, when I search with https://graph.microsoft.com/v1.0/users/96d86e71-60d8-4d9a-acad-bd708de3e29a/events I get the error "The specified object was not found in the store." Could someone help me?26Views0likes1Comment