Search code examples
asana

Asana: convert user @-tag to API object


I'm parsing the description of tasks for user links (@-tags) that we use to identify different roles on an item. I noticed something weird about the IDs though.

In the notes of a task returned from the API the @-tags are converted to links in the form https://app.asana.com/0/<int_id>/<int_id> which, when visited in the browser, show the user's tasks but when I use that ID to query the API as in https://app.asana.com/api/1.0/users/<int_id> I get a 403 with this response: {"errors":[{"message":"user: Not the correct type"}]} - further investigation showed that the IDs used in the @-tags are different from those used in the API for the same user, even though they both lead to the same page.

My question is are these IDs meant to be opaque or is there a way to convert them to the correct corresponding API IDs (short of browser scraping)?


Solution

  • Unfortunately, it's not possible at this time. In comments and notes (basically, anywhere in Asana that Rich Text is possible), we represent users as the URI to their "My Tasks" page, which is different from their User ID (as you noticed).

    We are exploring ways to close this gap, but don't have anything to share at this time. I know that's not super helpful, but I hope it at least helps to have a definitive answer :-(