Post

1 follower Follow
0
Avatar

Add resource to Project from Rest API

Dear Clarizen Developers,

Can you please help me to provide the Rest API call and sample request and response to add the resource to the project?

Regards,

Sreekanth.

Sreekanth A Answered

Please sign in to leave a comment.

5 comments

0
Avatar

Hi Sreekanth.

Use the /data/objects service with a RegularResourceLink. The properties you need are WorkItem & Resource, both are an EntityId.

Check the Clarizen Data Model for further information.

Sample Request:

Curl https://api2.clarizen.com/v1.0/services/data/objects/RegularResourceLink -X PUT -d {"Resource":"/user/9f2b8dd1-36e0-4886-807e-9d5fb6c07d32","WorkItem":"/Project/4bfc9995-6a9d-4a30-95a2-c4df57abaa43"}

 

Response will contain the new RegularResourceLink Id, e.g.:

{

"id": "/RegularResourceLink/9e9e5bb9-779c-4f6b-8477-c1f939c67ab2"

}

 

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Hi Ophir Kenig,

Thanks for the response. I have tried based on the above syntax and reviving the following error message. Can you please help me on this?

Service API URL: https://api2.clarizen.com/v1.0/services/data/objects/RegularResourceLink

Request:{"Resource":"/user/e788109a-2d57-42dd-a7e9-91156a2d6d7b","WorkItem":"/Project/2e60de99-71df-4d21-80bf-de7ba7b8aae1"}

response:{

"errorCode": "MissingArgument",

"message": "Missing argument: Id.Value",

"referenceId": "yb9jYJItBkyCwByCDgcHEA"

}

 

 

Sreekanth A 0 votes
Comment actions Permalink
0
Avatar

Hi Ophir Kenig,

Sorry i have used the post method instead of put, please ignore the above error. 

Thank you.

Regards,

Sreekanth

Sreekanth A 0 votes
Comment actions Permalink
0
Avatar

Hi Ophir Kenig,

Can you please help me to provide the url and sample request and response for the time sheet creation as well.

Regards,

Sreekanth

Sreekanth A 0 votes
Comment actions Permalink
0
Avatar

Hi Sreekanth,

I don't have a ready made sample for this. The type name for Timesheet is 'Timesheet'. Typically you'll need to fill in those fields: ReportedBy, ReportedDate & Duration (see the documentation for the use of Duration values).

If you need to know the type names and API field information to use, you can find them in the 'Configure' page in Clarizen

(https://app2.clarizen.com/clarizen/Pages/Customization/Customization.aspx?pid=4) or use the Metadata services (e.g. ListEntities & DescribeEntities). 

Hope this helps,

Ophir

 

Ophir Kenig 0 votes
Comment actions Permalink