Post

2 followers Follow
0
Avatar

REST v2 API

I want to be able to create projects using the api. I am able to do but I need to set the created by and project manager name using the userName property. 

{
"entity": {
"Id": "/Project",
"Name": "New Project Try 6",
"StartDate": "2019-11-01",
"DueDate": "2019-12-01",
"PlannedBudget":30,
"ProjectManager": "/userName/myEmail@email.com"

}
}

 

This is the error message that I am getting

{
    "errorCode": "InvalidType",
    "message": "Invalid type name 'userName'.",
    "referenceId": "1E7LG5SIjkFSBx4wr8trJ2"
}
 
I know I can use the user id but I can't find the property anywhere. The only thing I have is userName and Display Name
Prieto,Gaby Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Hello Gaby,

You will not be able to set the CreatedBy field - it will be populated with the user that was used when logging your application in (integration user).

As for populating the Project Manager field, try this:

{
"entity": {
"Id": "/Project",
"Name": "New Project Try 6",
"StartDate": "2019-11-01",
"DueDate": "2019-12-01",
"PlannedBudget":30,
"ProjectManager": "/User/ExternalId"

}
}

ExternalId needs to be replaced with an actual External ID that can be found in user properties. Example:

 

I hope this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink