Post

2 followers Follow
0
Avatar

What to supply for 'entity' field in data/createDiscussionResponse?

referenceId: 2qLfI1HMT8btPmuQbnAAdb

I am doing JUnit test for our connectors, which will be use by our integration product.

What do I need to supply to the 'entity' field?

I have done the basic operations that are documented in your REST API guide. I am having some hard time trying the non-documented endpoints. Thanks

Lnabong Answered

Please sign in to leave a comment.

3 comments

1
Avatar

Hi Lnabong,
The entity field should contain the object's (in this case, DiscussionResponse) properties, and optionally the desired object id. Please check the REST API documentation for more information.
There are 2 ways to figure out Clarizen entity fields.
1. You can use the API Metadata services to get the list of fields and their metadata.
2. In your Clarizen account, browse to Settings -> Configure (you may want to choose the entity class on the left side) to see the class API name and the list of standard fields with their API name.

Hope this helps,
Ophir

Ophir Kenig 1 vote
Comment actions Permalink
1
Avatar

Hi Lnabong,

var discussion = new
{
entity = new
{
id = "/DiscussionPost",
body = "Clarizen",
Container = "/task/4v2rjt51m9udnwsyj347ue7ul3"
}
};

This is in C# but I believe you'll get the idea. Notice I use "DiscussionPost". DiscussionMessage is a super class for "DiscussionPost" and "DiscussionReply", so it can't be created. You can see the classes hierarchy in the Clarizen Settings -> Configure page as I mentioned.
You must also fill the "Container" field, it's mandatory.

I didn't check the other fields (like related entities), though I can tell the Topic id has to of a Topic (not a task).
Hope this helps,
Ophir

Ophir Kenig 1 vote
Comment actions Permalink
0
Avatar

I can't edit my question, but what I mean is.. a sample requestBody for data/createDiscussion. My current request is like
{
"relatedEntities" : [ "/Task/2mkvn6jgdphiw4q6b3q8mnfue4" ],
"notify" : [ "/User/2945bqapb0y6tbl4ys1ystk5j3" ],
"topics" : [ "/Task/2mkvn6jgdphiw4q6b3q8mnfue" ],
"enitty" : { "id" : "/DiscussionMessage", "objectFields": { "createdOn": "2015-07-30" }}
}
When I tried removing Id( optional ), it prompts me "Missing argument Id.TypeName". I dont want to explicitly set the ID. Thanks!
"referenceId": "B8PEERShFncLHwzNzlc2W"

Lnabong 0 votes
Comment actions Permalink