Successfully connected to Asana but doesnt post task - asana

Im trying to post a task on asana through c#. The Json string that im sending is:
{"workspace":1234567890123,"data": {"name":"Buy eggs","notes":"Testing"}}
and the response I'm getting is:
{"data":{"id":123439968,"created_at":"2015-01-14T21:35:31.288Z","modified_at":"2015-01-14T21:35:31.288Z","name":"Buy
eggs","notes":"Testing","completed":false,"assignee_status":"upcoming","completed_at":null,"due_on":null,"workspace":{"id":12345678901234,"name":"CompanyName"},"num_hearts":0,"assignee":null,"parent":null,"hearts":[],"followers":[{"id":12345689965587,"name":"MyName"}],"projects":[],"tags":[],"hearted":false}}
But when I log into asana the task isn't there, what do I do?

The task has been created, but since it's not assigned to anyone or in any projects, it's not going to show up in any lists. The follower you added ("MyName") should be able to search for the task, but in general you want to specify a project to add to, or at the very least an assignee (so it shows up in their "My Tasks").

Related

Asana API - get all tasks and completion status

I am trying to use the Asana API to get all tasks within a project, as well as whether they have been completed. This seems to require the use of the opt_expand parameter, but I am having no luck with the following URL (and combinations of it): https://app.asana.com/api/1.0/projects/XXXX/tasks?limit=10&fields=completed&opt_expand=completed. Is this possible with the Asana API currently?
You need to use the opt_fields parameter in your GET request. Asana does not support generalized queries like completed=true. However, you can query for all tasks for a particular project and then filter the tasks by their completed_at value. The completed_at field will return a read-only time (e.g.'2012-02-22T02:06:58.147Z') of when the task was completed or null if the task is incomplete.
To return all tasks related to a project, including if they are complete, use this GET request: /projects/XXXX/tasks?opt_fields=name,completed_at.
For your reference, you can specify the options you want returned by using the parameters outlined in the Asana Input/Output Option docs. Also make sure to read the Asana Tasks docs to see which fields are available for the task resource.

Getting task creator in Asana API

I'm building an Asana API wrapper in python and trying to add functionality to get the creator of a task. As per the suggestion in this question: How to expose asana task creator? I'm loading the stories and inferring it from there but I assumed there'd be a story with the text 'created' as shows up in the web interface but the earliest story I see is always 'added to' then either a tag or project and there is no system story with the text 'created'
Is this the intended behavior of the API?
It's actually not the API but the fact that there actually isn't an event for the task being created - we store the creator and the creation time on the task, so it's kind of redundant (and saves creating a new DB object for every task creation - at scale the little things can add up). In the UI, we show task creation information inline with the other stories, but for the API you should just get that info from the task data itself.

Tags created via Asana API not associated with tasks are not returned in tags API call

In my tests... the newly created tag is not in the get request for tags when it isn't associated with a task. Once associated with a task it seems to appear in the response. However, once removed from a task it disappears from response.
For all intents and purposes, a tag that's no longer associated with any tasks doesn't exist. You may still see autocomplete suggestions due to caching in the web client, but the API won't show them anymore.
The long-term goal is to have tags simply behave like text labels. A string would uniquely identify a tag, and we can stop messing around with IDs and pretending they're proper resources.

Update URL in Asana returns nothing

When I use
https://app.asana.com/api/1.0/workspaces/workspace-id/tasks -d "name=this is a new task"
and then also using the POST method... I get a response, but nothing is created in asana...
This is the response in JSON format
{"data":{"id":5480677401703,"created_at":"2013-05-17T12:55:21.298Z","modified_at":"2013-05-17T12:55:21.298Z","name":"","notes":"","completed":false,"assignee_status":"later","completed_at":null,"due_on":null,"workspace":{"id":1337166104874,"name":"mecad.co.za"},"assignee":null,"parent":null,"followers":[{"id":1337166104857,"name":"Andries Koorzen"}],"projects":[],"tags":[]}}
But I don't see anything in asana
I guess you may have problem with the server itself. You would better start the ISS.
Rather, you can control the postLinkClicked method to see if there is a problem.
(I work at Asana) Where do you expect the task to show up? You have not given your new task an assignee or a project, so it will not show up in your My Tasks list, nor will it show up under any project. Try setting something in the assignee or project field.
But it also looks like you have a problem specifying details for the task, since you're attempting to pass a name but it's not being accepted by the system. My guess is something about the way you're doing this is not actually sending the correct POST data to the Asana API.

Asana API roadmap - getting completed tasks (including archived)

Do you plan to add possibility to retrieve (via API) all tasks from project including those which are archived?
(I work at Asana)
That would be a useful feature and we are already planning on adding it. However, I can't comment as to when it will be possible.
Until the API officially supports this, you can always query /tasks?completed_since=now to get only incomplete tasks, then query /tasks, and filter for tasks that only appear in the second list.
Archived tasks can be accessed by including the parameter ?include_archived=true in your request for querying tasks by project.
Task section in Asana documentation
I am trying to do this exact same thing as well. We are using a project to track line down events on our manufacturing floor. I found this post helpful and you can append “?include_archived=true” to your query but I found out that you can also do a reverse lookup on tasks by their tag. This will also show achieved tasks as well.

Resources