Your First Steps of Asana API with iOS/iPadOS/macOS Shortcuts App

Introduction
iOS/iPadOS/macOS users can try Asana API with Shortcuts App so easily!
Shortcuts App is a default App, so you don’t need make a environment.

I’ll introduce a example of making a new task into my task in a specific Organization or Workspace.

Preparation

  • get your PAT cf) Personal access token
    Caution!:PAT is very important.You can’t share it with anyone.
  • get your workspce ID you want to make a new task into
  • get your user ID
  • find your Sortcuts App in your device

Let’s get started!

  1. launch your Shortcuts App and tap “+” button
    image
    :arrow_down:

  2. Append two actions below,

  1. Tap “prompt” of “Ask for input” , input “task name” and check off “Allow Multiple Lines”


    :arrow_down:

  2. Erase “Provided Input” and input URL below,
    https://app.asana.com/api/1.0/tasks"


    :arrow_down:

  3. Open the option of “Get contents of” and input below,
    a) Change “Method” to POST


    b) Set headers to three items below,
    key : text
    accept: application/json
    authorization: Bearer PAT(you got in the preparation)
    content-type: application/json
    :arrow_down:

  4. Set “Reauest Body” like below,
    a) Add new field as Dictionary and set “data” as a key


    :arrow_down:

    b) Tap 0 items

    :arrow_down:

    c) Add a new field and select Text

    d) append 3 fields below,
    key : text
    name: select “Provided Input” from “Select Variables”
    workspace: workspace ID(you got it in Preparation.)
    assignee: user ID(you got it in Preparation.)
    due_on: select “Current Date” from “Select Variables”

    e) Tap “Current Date” , set “Date Format” to “ISO8601” , check off “ISO 8601 Time” and click “Done”

That’s it.
Now you can make a new task from the shortcut.
If you are a iOS user, you can set the shortcut to back tapping of your iPhone.

4 Likes

What is the benfit of using the API with the shortcuts app? Couldnt I just open the Asana app and make a new task? I guess I dont see the point of going through all of these steps. Can you share a useful case where this would be beneficial?

@austinwiz999
Thank you for your comment.
The primary purpose of this post is to provide a beginner’s guide to using the Asana API.
Therefore, I didn’t prioritize the practical applications of the API in this particular post.
Instead, I focused on making the explanation as simple and easy to understand as possible.

By the way, that’s very helpful for me because I can quickly create a task by setting a shortcut for a back tap on my iPhone.
Furthermore, I find it beneficial to be able to create tasks in specific workspaces, given that I use multiple workspaces and organizations.

And perhaps this will also work with the upcoming “Action button” on the new iPhone 16!

2 Likes

Thank you for this explanation. Looking around the Asana forum and the internet at large, I’m surprised that this info isn’t more sought after.

I am quite new to shortcuts so I’m eager to use this. However I have tried and tried with your step by step guide and cannot for the life of me get it to work.

@Tetsuo_Kawakami Can you please confirm whether you need to adapt the URL input in step 4. to your own personal project URL? And if so, to find this info do I just find my specific project URL and enter this in?

Can you please confirm the following so i can check if I’m inputting the right info:

  • Where do I find my workspace ID? Is this the workspace or project?
  • Where can I find my User ID:
  • Do I need to amend the URL in step 4 to my own project URL: And if so where do I find this?

Ultimately, I am trying to set up a shortcut in the shortcut app that creates a new task in a specific project. Also the ability to add tags, due date and add into other projects would be handy too.

Thanks so much in advance

Hi, @Georgia15

About the URL in step4

About your workspace ID and User ID

  1. get your PAT from Personal access token
  2. access to Get a user
  3. input “me” like below(red circle)
  4. input your PAT and click “Try it!” like below(red line and circle)
  5. you can get your workspace ID and user ID

No, you can’t amend the URL.
You need to add another field as array for the project in step 6,c).
projects : specific project ID

Make sure you set value as text type.


:arrow_down:

Please check below if you need to add some properties.

@Tetsuo_Kawakami I’m sure going to try this!

Love it!

:pray:

1 Like