Expand my Community achievements bar.

API - Adding Tasks to existing projects

Avatar

Level 1
Hello, I'm currently working on the WF's API in C# language, with all the examples provided, I was successfully able to create projects but when it comes to create tasks under projects, I am prompted by the 'System.NullReferenceException'. I've tried to keep it simple to have correct values, but so far the error message doesn't specify exactly what fields I require in order to add a task. See below the image. What are the required fields in order to create a Task? Hiro Asamura The Kenan Advantage Group Inc
1 Reply

Avatar

Level 10
Hi Hiro, As per the "https://support.workfront.com/hc/en-us/articles/115003574147-API-Basics">API examples , when you are creating a new object, the ID is not passed in; since it's New, WF will pass back the resulting ID once the data is committed to the database. For objects that have parent objects (such as Tasks, in your case), the ID of the Parent (eg projectID) is required. The API /metadata doesn't indicate which fields are required (yet), but if you download a kickstart, the column headers that are in bold mean the parameter is required. Regards, Doug Doug Den Hoed - AtAppStore Got Skills? Lend a hand! https://community.workfront.com/participate/unanswered-threads