api
50 TopicsIssue with EntityLinks in Project Online API
Hello everyone, I'm working with Project Online and trying to retrieve task data via the API. While reviewing the metadata, I noticed that PublishedTasks have a navigation property called EntityLinks, but I couldn't find clear documentation on its purpose or usage. What I Tried I attempted the following API requests: Retrieve EntityLinks for a task: GET https://{sitename}.sharepoint.com/sites/pwa/_api/ProjectServer/Projects(guid'{validProjectId}')/Tasks('{validTaskId}')/EntityLinks Expand EntityLinks within tasks GET https://{sitename}.sharepoint.com/sites/pwa/_api/ProjectServer/Projects(guid'{validProjectId}')/Tasks?$expand=EntityLinks Observations When the project has tasks, the request fails with: { "odata.error": { "code": "42, Microsoft.ProjectServer.PJClientCallableException", "message": { "lang": "en-US", "value": "PJClientCallableException: GeneralUnhandledException\r\nGeneralUnhandledException\r\nException = System.NotImplementedException: The method or operation is not implemented.\r\n at Microsoft.Office.Project.Server.BusinessLayer.EntityLinks.ThrowIfEntityLinksNotSupported()\r\n at Microsoft.Office.Project.Server.BusinessLayer.EntityLinks.ReadEntityLinksForEntities(Guid[] entityUids)\r\n at Microsoft.Office.Project.Server.Wcf.Implementation.CSOMImpl.<>c__DisplayClass35_0.<ReadEntityLinksForEntities>b__1()\r\n at Microsoft.Office.Project.Server.BusinessObjectMethodInvocation.InvokeBusinessObjectMethod(String methodName, IEnumerable`1 actions)" } } } If the project has no tasks, the request returns an empty response without errors { "odata.metadata": "https://{sitename}.sharepoint.com/sites/pwa/_api/$metadata#SP.ApiData.PublishedTasks", "value": [ ] } Other navigation properties (e.g., Predecessors) work fine with a similar request. Questions What are EntityLinks, and what do they refer to? How can they be created via the UI in Project Online? Is there a way to retrieve them successfully through the API? I couldn't find references for this error or EntityLinks. Any insights would be greatly appreciated! Thanks in advance!26Views0likes0CommentsIssue with EntityLinks in Project Online API
Hello everyone, I'm working with Project Online and trying to retrieve task data via the API. While reviewing the metadata, I noticed that PublishedTasks have a navigation property called EntityLinks, but I couldn't find clear documentation on its purpose or usage. What I Tried I attempted the following API requests: Retrieve EntityLinks for a task: GET https://{sitename}.sharepoint.com/sites/pwa/_api/ProjectServer/Projects(guid'{validProjectId}')/Tasks('{validTaskId}')/EntityLinks Expand EntityLinks within tasks: GET https://{sitename}.sharepoint.com/sites/pwa/_api/ProjectServer/Projects(guid'{validProjectId}')/Tasks?$expand=EntityLinks Observations When the project has tasks, the request fails with: { "odata.error": { "code": "42, Microsoft.ProjectServer.PJClientCallableException", "message": { "lang": "en-US", "value": "PJClientCallableException: GeneralUnhandledException\r\nGeneralUnhandledException\r\nException = System.NotImplementedException: The method or operation is not implemented.\r\n at Microsoft.Office.Project.Server.BusinessLayer.EntityLinks.ThrowIfEntityLinksNotSupported()\r\n at Microsoft.Office.Project.Server.BusinessLayer.EntityLinks.ReadEntityLinksForEntities(Guid[] entityUids)\r\n at Microsoft.Office.Project.Server.Wcf.Implementation.CSOMImpl.<>c__DisplayClass35_0.<ReadEntityLinksForEntities>b__1()\r\n at Microsoft.Office.Project.Server.BusinessObjectMethodInvocation.InvokeBusinessObjectMethod(String methodName, IEnumerable`1 actions)" } } } If the project has no tasks, the request returns an empty response without errors: { "odata.metadata": "https://{sitename}.sharepoint.com/sites/pwa/_api/$metadata#SP.ApiData.PublishedTasks", "value": [ ] } Other navigation properties (e.g., Predecessors) work fine with a similar request. Questions What are EntityLinks, and what do they refer to? How can they be created via the UI in Project Online? Is there a way to retrieve them successfully through the API? I couldn't find references for this error or EntityLinks. Any insights would be greatly appreciated! Thanks in advance!12Views0likes0CommentsLink two projects in Project online using REST API
Hi All, I have a requirement where I need to link multiple projects to a master project programmatically in Project Online. I've explored several options but haven't had any success so far. I'm looking for guidance or best practices to accomplish this task. I have the option to use either Python or Power Automate, so any insights or solutions using these tools would be greatly appreciated. Thanks in advance for your help.29Views0likes2CommentsAccessing Project REST API throws error: Exception of type 'Microsoft.IdentityModel.Tokens.AudienceU
I am trying to access the Project Online REST API http://ServerName/ProjectServerName/_api/ProjectData/Projects More precisely my query is the following "https://" + sharepoint_url + "/sites/pwa/_api/ProjectServer/Projects('" + project_id + "')/Assignments('" + project_task_id + "')/Resource" Now what I am challenges with, is the right authentication. I am trying to impersonate two natural users, the application is registered in AAD and I also get a token. But I get either one of the two errors {"error_description":"Unsupported security token."} or {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."} I am happy to provide further details, but I am a bit lost in the API jungle from Microsoft. Unfortunately it appears that Graph API does not (yet?) support Project Online. I was already following those guides here: https://docs.microsoft.com/de-de/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow http://pratapreddypilaka.blogspot.com/2018/05/sharepoint-online-authentication-for.html No positive result. I do get tokens, but the errors remain.2.8KViews1like3CommentsHow to Submit a Timesheet on Behalf of Another User in Project Online using API?
I develop a flow that once a week submit timesheets for all users. Is there a way to submit a timesheet on behalf of another user? I have tried the endpoint: _api/ProjectServer/TimeSheetPeriods('periodid')/TimeSheet However, it works only in the current user's context. When I run a Power Automate flow as an Admin, the flow can only see the Admin's timesheets. Could you please advise how I can submit a timesheet for another user?33Views0likes0CommentsProject Online (CSOM): Encountering 'User Not Found in Active Directory or Project DB'
Issue We are attempting to access Project Online data in Project Permission mode using app-only authentication, specifically to bypass MFA for programmatic access, as we aim for continuous, automated access without any user-interaction. We are using CSOM, using Microsoft.ProjectServer.Client.ProjectContext in .NET 4.8 to connect to Project Online. Despite following several documented approaches with client certificates, client secrets, and OAuth configurations, we keep encountering errors like 401 Unauthorized and User not found in Active Directory or in project db. Below is a summary of our steps. Despite multiple attempts, we consistently receive errors blocking access. We have followed recommended documentation for client credentials, certificates, and permissions but still face access issues. Technology Project Online CSOM in .NET 4.8 Microsoft.ProjectServer.Client.ProjectContext Azure AD (Entra ID) Solutions Attempted Client Certificate Authentication: Configuration: Registered an app in Azure AD (Entra) with a client certificate and set permissions including Sites.FullControl.All. NOTE: we could not select Project permissions (Project.Read, etc.) in the Application Permissions screen, only within the delegated permissions screen. Token Acquisition: We acquired an access token using az account get-access-token --resource=https://.sharepoint.com. Request Attempted: URL: https://.sharepoint.com/sites//_api/ProjectData/Projects Outcome: {"error":"invalid_request","error_description":"App is not allowed to call SPO with user_impersonation scope"} Client Secret with Client Credentials: App Registration: Configured client ID and client secret in Azure AD with permissions for Project.ReadWrite.All and Sites.Selected. Token Acquisition: Called the token endpoint: Endpoint: https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token Parameters: client_id, scope= https://.sharepoint.com/.default, client_secret, grant_type=client_credentials Access Attempt: URL: https://.sharepoint.com/sites//_api/ProjectData/Projects Response: HTTP/1.1 401 Unauthorized Response Body: " " Outcome: Despite obtaining a valid token, the request returns a “Please sign in” page, rather than an access token. SharePoint AppPermissionRequest Configuration using /sites/pwa/layouts/15/appinv.aspx: Configuration: Set up AppPermissionRequest XML in SharePoint for permissions like: Outcome: This configuration did not make any differences, and did not grant the required permissions in Project Permission mode, as SharePoint app permissions do not seem to cover Project-specific access, it seems. Project Online access remains blocked. <AppPermissionRequest Scope="[http://sharepoint/content/sitecollection]" Right="FullControl"/> Microsoft Graph API Exploration: Goal: Investigated Graph API as an alternative. Outcome: Microsoft Graph lacks Project Online-specific permissions, limiting access to SharePoint and directory data, which does not meet our need for project-specific data access. Microsoft.Identity.Client and client certificate Configuration: CSOM using the following code to login: Outcome: Access fails with User:<customercontent></customercontent> not found in Active Directory or in project db public static void Login(this ProjectContext context) { var clientId = "xxx"; var clientSecret = "xxx"; var authority = "https://login.microsoftonline.com/xxx"; var scope = "https://xxx.sharepoint.com/.default"; var certificate = new X509Certificate2("c:\\temp\\cert.pfx", "xx"); var app = ConfidentialClientApplicationBuilder.Create(clientId) .WithCertificate(certificate) .WithAuthority(new Uri(authority)) .Build(); AuthenticationResult result = TaskHelper.BlockingAwait(() => app.AcquireTokenForClient(new[] { scope }).ExecuteAsync()); string accessToken = result.AccessToken; context.ExecutingWebRequest += (sender, e) => { e.WebRequestExecutor.RequestHeaders["Authorization"] = "Bearer " + accessToken; }; } Key Questions: Is there a method for app-only authentication in Project Online in Project Permission mode__ that bypasses MFA for automated access? Has anyone succeeded in applying app-only credentials for Project Online access__, specifically in Project Permission mode? Are there any alternative permission configurations__ (like Azure AD settings, conditional access policies, or app permissions) that could facilitate this access? Thank you in advance! Edit: Sorry for the bad formatting.80Views0likes0CommentsMS Project Online (CSOM) read Assignment history
I need to get status of approvals of the assignments in MS Project Online I want to look at History, find latest record and see its approval status. I use following code to retrieve History: TimePhase timePhase1 = employee._mspStatusAssignments.GetTimePhase(Start.Date, End.Date); _projectContext.Load(timePhase1); _projectContext.Load(timePhase1.Assignments); _projectContext.ExecuteQuery(); StatusAssignment statusAssignment1 = timePhase1.Assignments.FirstOrDefault(x => x.Id.ToString() == ID); _projectContext.Load(statusAssignment1.History); _projectContext.ExecuteQuery(); But this code throws exception at ExecuteQuery when attempt to retrieve History when history has more than 0 items: Exception Message: The type of data at position 642 is different than the one expected. StackTrace: at Microsoft.SharePoint.Client.JsonReader.ReadDateTime() at Microsoft.ProjectServer.Client.StatusAssignmentHistoryLine.InitOnePropertyFromJson(String peekedName, JsonReader reader) at Microsoft.SharePoint.Client.ClientObject.FromJson(JsonReader reader) at Microsoft.SharePoint.Client.JsonReader.ReadJsonObject(Type fallbackType) at Microsoft.SharePoint.Client.JsonReader.ReadObject(Type fallbackType) at Microsoft.SharePoint.Client.JsonReader.ReadObjectArray(Type fallbackElementType) at Microsoft.SharePoint.Client.ClientObjectCollection`1.ReadChildItems(JsonReader reader) at Microsoft.SharePoint.Client.ClientObjectCollection.InitOnePropertyFromJson(String peekedName, JsonReader reader) at Microsoft.SharePoint.Client.ClientObject.FromJson(JsonReader reader) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse() at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery() Can anyone suggest what could be causing this problem? Thank you25Views0likes0CommentsProject Online Task notes update using Rest Api
Hello, I am able to create a new task and then I can give the value for notes field which works fine but when I try to update the same "Notes " field then the update doesnt happen using the rest api I am using below rest api with Patch method _api/ProjectServer/Projects(<project_id>)/Draft/Tasks(<Task_id>) Body: {'Notes': value}2.5KViews0likes2CommentsUpdate lookup table values through Rest api
I am trying to create new entry in lookup table using Rest but getting an error. ERROR : An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected. clientRequestId: af31b745-2214-4635-9a45-0fa1311e7d2c serviceRequestId: aea3c29f-30ba-b000-fc46-67eccb973d3b Using Post message : URI: _api/ProjectServer/LookupTables('00008e67-65a3-4898-baaa-d82d995bbb02')/Entries/Add Body {'parameters':{ 'Value':'110', 'Description':'Added from Flow', 'SortIndex':'7', 'ParentId':'dd67bf95-85a3-eb11-bfa0-00155dc0a600' }} Using following References https://docs.microsoft.com/en-us/previous-versions/office/project-javascript-api/jj668218(v=office.15) https://docs.microsoft.com/en-us/previous-versions/office/project-javascript-api/jj668483(v=office.15)1KViews0likes1CommentMicrosoft Project for the web API
Hello community, I need to work with MS Project for web over api, CRUD projects, CRUD tasks and etc from https://project.microsoft.com/ with using an API. I searched and couldn't find any documentation or SDK to do it. Only one page from offecial source about API here https://learn.microsoft.com/en-us/project-for-the-web/projectforweb-admin-home that point to https://devblogs.microsoft.com/microsoft365dev/tag/project/ The both links without any API description for Project for the web. Is there any documentation for an API to integrate with Project for the web? Thank youSolved2.1KViews0likes1Comment