AnsweredAssumed Answered

Why do some, but not all, entities allow "xxx_id" for referenced records?

Question asked by scott.leckie@kwolo.com on May 4, 2017
Latest reply on May 8, 2017 by Yum Darling


In the Sites API documentation, it is clear that you can specify the manager via their id:

 

<location> (text),

<description> (text),

<time_zone> (name, e.g. “Hawaii”),

<business_record_id> (ID of Business Hour),

<language> (two-letter code, e.g. “en”, “fr”),

<manager_id> (user only, not group),

<manager><email>,

<default_assignee_id> (user or group)

 

This is very convenient because, once we know a user ID, we can easily apply this to multiple updates using this syntax:

<manager_id>123456</manager_id>

 

But in other entities, notably incidents, this ..._id shortcut is not available. Instead, we need to specify a lookup, like this:

<requester><email>demo@samanage.com</requester></assignee>

 

There's a secondary question here, about why not all lookups are available in that structure (we can't say "<assignee><name>...", for example) but my primary question here, is why we cannot use the same structure as that in Sites?:

<requester_id>123456</requester_id>

 

This would make the update code much more consistent.

Outcomes