Discussion Forums

Activity Hierarchies

 
Sentinel
28 posts

Can you please explain this in more detail:

Supported Activity Hierarchies
Parent {itemId} [> Child] [> Child]
Contact > Call > Comment
...
Contact > Website > Comment

Specifically, how is this supposed to be called?

I’m a novice at poking around code but I’ve been playing with curl all night and getting the hang of things.

What I want to do is add a call, then add a comment to that call.

I am not sure what this is telling me to do: “Parent {itemId} [> Child] [> Child]“

Am I supposed to pull the call id after creating it and then post the comment to parentid/callid? Or what exactly?

Thanks!

Avatar
Administrator
1823 posts

The Supported Activity Hierarchies chart indicates what an activity can be connected to e.g. create a contact, then you can attach a call log to the contact, then you can attach a comment to the call log, but you could not connect a comment to a contact.

When creating any type of activity you must provide the PARENT parameter.  This indicates what the activity you are creating should be connected to e.g. when creating a call log specify the contact’s ID as the parent, when creating the comment specify the call log’s ID as the parent.

When you create an item the response includes the ID of the newly created item.  This makes it easier to create a chain of related items without having to search for the IDs.

Sentinel
28 posts

Thanks! This is perfect, and a simple explanation.

I had intuitively figured this out, but my code was breaking so I thought I was doing it wrong.

Turns out I was using <data>text</posttext></data> which it didn’t like. I guess you only name the fields when there is more than one field posting?

Anyhow, I’m getting the hang of this. I can’t wait to get my top secret prototype working so I can share it with you guys smile

Sentinel
28 posts

But, alas, I did something wrong.

The comment showed up like: “undefined wrote:“

So what did I miss? Clearly there is a logic behind which fields are required for which types of activities, but in the documentation is only says “posttext” is required.

Looking at another post there was also “postuser” and “postdate”. Shouldn’t these be implied by the credentials and time of a comment being posted to the API?

Can you point me at a more comprehensive reference for decoding and grokking the API? Or just slap me silly so it all makes sense? :p

Thanks!

Avatar
Administrator
1823 posts

Here is what I used here:

curl -'{userEmail}:{userApiToken}' -X POST -'Content-Type: application/xml' -'<request><parent>713730</parent><data><posttext>Inspected property</posttext></data></request>' https://secure.solve360.com/contacts/comment 

The user’s name did appear correctly.  If it doesn’t show the same for you please send our support team the exact command your using so they can verify check the configuration of the account that is authenticating and see what’s happening.