0

i tried to poll tasks with hearts opt_field. In the documentation the specified json structure was

hearts  [ { id: 1245, name: "Mittens" }, ... ]

but when when polled we get,

"hearts": [
    {
      "id": 17818qwerty545640,
      "user": {
        "id": 104764787853157345,
        "name": "Gurdy Code"
      }
    },
    {
      "id": 17827xxxxuyyyy34676,
      "user": {
        "id": 1zxxcv672489,
        "name": "Boumer Weckhunt"
      }
    }
  ]

does the id in the outer brackets have any usage?

1 Answers1

0

The outer ids are the IDs of the hearts themselves - they are in a sense resources in their own right. They have a user and a created_at, which is the time when the user hearted the resource in question. You're absolutely correct that the documentation needs to be updated.

agnoster
  • 3,744
  • 2
  • 21
  • 29
  • if a situation arises to unheart a task via api, should we need to remove outer heart's id or just remove the follower's id to the task. my previous comment is not displayed. don't know what happened to it. – Task Depot Oct 16 '14 at 08:05
  • You cannot remove other users' hearts. The user who the API is acting on behalf of can un-heart by setting `hearted: false`. – agnoster Oct 16 '14 at 19:05