Using our Pocket Developer HTTP Request plugin, you can create tasks in Asana directly from Campaign Builder. (Note that details about Asana’s API are available here.)
- To use Asana’s API, you will need to get a Personal Access Token from Asana. Follow Asana’s instructions to create your Personal Access Token. Be sure to copy the token and keep it in a safe place! The token begins with 0/ followed by a long alphanumeric string. (Note that anyone with access to Campaign Builder will be able to see this key to your Asana account. You could create multiple tokens for multiple purposes if you like, but to make things simple I just created one called “Infusionsoft Posts” that I use for all posts from Infusionsoft.)
- Creating an Asana task requires designating a project. To get a project’s identifying number, click on the project name in the left nav bar in Asana. In the url bar, you will see a number between backslashes, appearing just before /list. Copy this project number for later. (If you don’t want to designate a project, you can designate a workspace instead.)
- If you want to assign the task to someone, you will need their identifying number as well. Unfortunately there isn’t any url exposure of this information, but once you are logged in to Asana you can get a list of all the users in your account by going to https://app.asana.com/api/1.0/users. Look for the id number that corresponds with the person to whom you want to assign the task; the id number comes before the name inside braces. (You can similarly get a workspace id by using /workspaces instead of /users in the url.)
- In Campaign Builder, create an HTTP Post. The Post URL will be https://pocketdeveloper.net/Blocks/HttpRequest/ and the parameters will begin with
- App = YOUR PDEV TOKEN
- contactId = ~Contact.Id~
- url = https://app.asana.com/api/1.0/tasks
- additionalHeaders[0] = Authorization: Bearer INSERT YOUR PERSONAL ACCESS TOKEN
- params[projects] = YOUR PROJECT ID NUMBER (Note that you can assign the task to multiple projects by using a comma-separated list.)
- params[asignee] = ID NUMBER OF PERSON TO ASSIGN TO THE TASK (optional)
- params[name] = THE TITLE YOU WANT TO GIVE THE TASK (Note that you can include merge fields for dynamic data input.)
Now you are ready to publish your HTTP Post and test run it. (For more information on Asana task parameters you can set, see https://asana.com/developers/api-reference/tasks#create.)