none
Project Server 2016 RRS feed

  • Question

  • Hi All,

    I have installed and configured SharePoint 2016 and project server 2016 as service application.

    everything(new Project created, Task creation for that project) works fine while using the SharePoint UI.

    But the same thing is not working when tried to use the code. I am looking for some expert assistance for the below points.

    • Need to create a project by using code(C#, rest api)
    • While creating new project some default tasks has to create automatically.


    Ramesh

    Monday, July 31, 2017 12:30 PM

Answers

  • Hi,

      Please find the below code to create project using REST API 

                    url: _spPageContextInfo.webAbsoluteUrl + "/_api/ProjectServer/Projects/Add",
                    type: "POST",
                    data: JSON.stringify
                        ({
                        'parameters': {
                            'Id': $projectid,
                            'Name': 'Project_' + $projectid,
                            'Description': 'Sample'
                        }
                        }),
                    contentType: "application/json;odata=verbose",
                    headers:
                    {
                        "Accept": "application/json;odata=verbose",
                        "X-RequestDigest": $("#__REQUESTDIGEST").val(),
                        "X-HTTP-Method": "POST"
                    }
    • Marked as answer by s.s.rameshram Tuesday, August 1, 2017 8:55 AM
    Tuesday, August 1, 2017 8:50 AM