0

I would like to know how to get the IDs of users who added a heart in a comment. I am able to get the heart IDs, but it's not useful if I don't know the user who added that heart.

Currently I'm using this API call:

$t = $asana->getTaskStories('14575329695751', array("opt_fields"=>"hearts"));

Output:

{"data":[{"id":14575329695752},{"id":14575329695753},{"id":14575329695754},{"id":14583810864882},{"id":14605823660851},{"id":14605823660853,"hearts":[]},{"id":14631534715087,"hearts":[]},{"id":14704515309441,**"hearts":[{"id":14708668721707},{"id":14712262220995}]}**,{"id":14704539740313,"hearts":[]}]}

I get the story ID and the heart ID, but I am unable to get the user ID / name who added those hearts.

Luke Peterson
  • 8,584
  • 8
  • 45
  • 46
Bing
  • 3
  • 2

1 Answers1

1

Hearts themselves have properties of their own you can include with opt_fields. For example, if you included opt_fields=hearts.user.name it will show the user (with name and ID). Hearts have the properties user, created_at, and target.

Documentation for hearts will be added to the public docs soon, but hopefully that helps in the meantime.

agnoster
  • 3,744
  • 2
  • 21
  • 29