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

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.

Related

Website contact form to Asana Api

I am interested to allow my website to send a webform data to an asana project, its for collecting responses from potential clients.
I am unsure the best way to do this, since by using the form, I do not want that the user is required to login, or signup, or anything such as that, the form submission should be anonymous, it should just take whatever is posted and create a task in asana with the text given.
From the documentation, it appears that its always required to login, or connect with asana and this obviously isn't going to work since people are not going to do that in order to send me feedback from the website.
So, is there a way to do this, in the way mentioned above?
You're right in that you need to have an Asana account to make API calls as a particular user. However since you want the submissions to be anonymous anyway, there's a pretty simple way: you can create a bot account and use that to submit the form. For instance, create an Asana user called "forms_bot#yourdomain.com"; make sure it can see the project in which you want to collect the form submissions. Get its credentials from inside Asana, and use these on your server to make the API calls to Asana to submit the information. In this way you will see the tasks created by "forms_bot#yourdomain.com".
We use this idiom very frequently at Asana for these sorts of flows, and as an added plus it makes it very clear where the information came from in the first place (as opposed to seeming as if there were an actual user in your domain that's creating the tasks). Hopefully this makes sense and will allow you to get the workflow you want set up!

How to dispaly a holding screen whilst ActiveJob retrieves lots of data from an external API

I have an application that makes API requests to salesforce using restforce.
Specifically the application finds a contact object, returns IDs for all related objects and then pulls the full record for every related object based on their ID.
This takes a long time for two reasons:
There are a lot of request to an external API, usually takes a few fractions of a second for each to reply and for some there can be +500 individual requests.
There is often a large amount of data being pulled back via each request.
All requests currently fall within the salesforce rest API limits but I'm getting timeout errors from my development server as it can take 5+ minutes for some of these requests to process.
Rails 4.2 - How best to handle this?
My question is how do I best get rails to handle this?
I can fire the API requests either from the controller (which definitely violates the skinny controllers) or from the view (via helper methods, which seems like a dodgy hack).
Ideally I'd like to get it running in a background job, but i'm unsure if I can just include all the authentication and other methods in a job in the same way I can include helper methods?
Even if I could get it to work in a background job, I'm unsure what best practice might be for the user experience. Ideally I'd like to route them to a page telling them to "hang tight, go get a coffee" with a progress bar, and then auto route them to the final page once the request is complete...
But I'm unsure how to generate a temporary display until a job has been completed?
Could anyone recommend any gems or strategies that might help me digest this problem?
You should definitely use a background job for this.
Give a database object to the job, which it will update to signal that is has finished, and maybe from time to time to indicate progress.
On the user side, simply tell them that the background job is working, with eventually a progress indicator, and display the result once the database object giving to the job tells you it's ready.

How to set Asana so emailed-in Tasks are brought to my attention when I log in, without manually searching for them each time?

I just started using Asana to manage bug fixes/feature requests from my clients, and I can't hardly believe that every single time I open it I need to manually ask it to show me unassigned tasks and assign them by hand to myself to get them to appear on the My Tasks view. Anything coming in by email (which is how I'm going to have my clients do it) is unassigned, and Asana gives me absolutely no clue when I log in if an unassigned task is waiting for me to assign it, and it will remain hidden from my to-do list (the My Tasks view) until I do.
There are existing solutions on SO for how to search to find unassigned tasks; those are not what I'm after, as those are how to do manual one-time searches, but I want Asana to tell me the things I need to know about without me either having to remember to manually ask for them every single time I log in, or risking missing something time-sensitive.
Alternatively, if it would either automagically assign mailed-in tasks to me, or let me set my "All Tasks" bookmark to be the default view as soon as I log in, either of these would suffice. I can't find any way of doing any of these things—my goal is that 100% of user-submitted tasks be brought to my attention without me having to remember to look for them (otherwise I could just stick with my dubious previous system of remembering to search my email inboxes.)
If you're using one email address to assign tasks (from a form or whatever) you can go to account settings -> from email and add your email address. That will automatically assign those tasks to you.
Here's the asana docs for it: https://asana.com/guide/help/email/email-to-asana
Otherwise, you can use Zapier (or similar service) to manage creating tasks via email for you if you'd prefer not mess around with the API.

Searching for a song while using multiple API's

I'm going to attempt to create an open project which compares the most common MP3 download providers.
This will require a user to enter a track/album/artist name i.e. Deadmau5 this will then pull the relevant prices from the API's.
I have a few questions that some of you may have encountered before:
Should I have one server side page that requests all the data and it is all loaded simultaneously. If so, how would you deal with timeouts or any other problems that may arise. Or should the page load, then each price get pulled in one by one (ajax). What are your experiences when running a comparison check?
The main feature will to compare prices, but how can I be sure that the products are the same. I was thinking running time, track numbers but I would still have to set one source as my primary.
I'm making this a wiki, please add and edit any issues that you can think of.
Thanks for your help. Look out for a future blog!
I would check amazon first. they will give you a SKU (the barcode on the back of the album, I think amazon calls it an EAN) If the other providers use this, you can make sure they are looking at the right item.
I would cache all results into a database, and expire them after a reasonable time. This way when you get 100 requests for Britney Spears, you don't have to hammer the other sites and slow down your application.
You should also make sure you are multithreading whatever requests you are doing server side. Curl for instance allows you to pull multiple urls, and assigns a user defined callback. I'd have the callback send a some data so you can update your page with as the results come back. GETTUNES => curl callback returns some data for each url while connection is open that you parse it on the client side.

Showing status of current request by AJAX

I'm trying to develop an application which modifies a couple of tasks of the famous Online-TODO List RememberTheMilk (rememberthemilk.com) using the REST API.
Unfortunately the modifying takes a lot of time, so I want to give a feedback to the users.
My idea was just to display a couple of text lines (e.g. modifying task 1 of n...).
Therefore I used the periodically_call_remote on my page and called a which reads a Singleton.
In the request I store the text that should be displayed in the same singleton. But I found out, that once I set up a request, the periodically_call_remote does not update the specified div.
My question to this:
1. is this a good way to implement this behaviour?
2. if it is, how do get the periodically_call_remote to work during a submit?
Using a Singleton is most definitely a bad idea. In an advanced production setup it isn't guaranteed that subsequent requests will go to the same process or to the same machine (and subsequently will have a different Singleton). Plus, if you have many users, I don't even want to think about what'll happen to those poor Singletons.
Does any of this stuff actually need to go through your Rails app? It seems like you can call the RTM API via Javascript from the page the user is on and then update the page when the XHR request is complete.

Resources