Help with Asana and Zapier using Webhooks

I’ve been using Zapier for business automation for a while now with good results. We’re moving over from Basecamp to Asana for project management and there are some things I need to automate that the Zapier interface doesn’t support, but the Asana API does allow.

For example, it looks like the Asana API allows for creating sections within a project. While I can’t do that with the native Zapier+Asana integration, it looks like I can interface with the Asana API directly if I use Webhooks through Zapier.

Right now I’m trying to get my bearings and just do some basic things with the API so I can branch out from there. I’ve already created a Personal Access Token and have been able to run basic commands through Terminal, such as: curl -H "Authorization: Bearer 0/1234567890” https://app.asana.com/api/1.0/users/me

However, when I try to perform a simple /users/me call through Zapier I am getting stuck with authentication problems. Here’s what the data entry fields in Zapier looks like:

Unfortunately, when I send through this data as a test it comes back with a “Not Authorized” error:

I think it would work if I cleared out the “data” field and just replaced the URL field with something like this (below), but I don’t think I have the syntax correct:

https://app.asana.com/api/1.0/users/me?Authorization:%20Bearer%200/123456787890

If I wanted to run the users/me call in a new private browser window, not already logged in through Asana, but authenticating via the URL only, what would that syntax look like? I can’t seem to find any documentation on that.

Thanks very much for any help you can provide.

I haven’t tried to use this aspect of Zapier so am not 100% sure, but I’d make two comments:

First, Asana expects authentication via an HTTP Header, so in the Headers section, I’d try putting:
image

where 0123456789 is your PAT.

Second, I’m not sure where the idea came from to put program code in the Data section but I am almost positive that’s not going to work as you’re expecting. What you’re building here is an HTTP REST Request. There is no program code involved at all in what you specify in such a request.

In an HTTP GET request, there will be no data so leave that blank. (In a POST request, there is often data but it will likely be in the form of JSON strings.)

If you’re planning to use this approach to communicate with the Asana API, you’ll probably want to get familiar with how HTTP REST Requests work.

4 Likes

Thank you Phil, putting he authorization PAT in the header area like you demonstrated worked perfectly. That’s really the help I needed to get past this authentication problem. I should be able to make some good progress from here. Thank you!

1 Like