Skip to content

Getting to know Asana webhooks API and building simple bot that listens for Asana comments and publishes them to RabbitMQ

Notifications You must be signed in to change notification settings

walkingpendulum/asana-studies

Repository files navigation

asana-studies

webhooks studies

  1. Install grok tool. brew install ngrok for MacOS users. Follow instructions on https://dashboard.ngrok.com/get-started/your-authtoken to configure it.
  2. Run ngrok http 8090. This will block, so do this in a separate terminal window.
  3. Copy the subdomain, e.g. e91dadc7
  4. Create a new PAT - we're going to use ngrok on prod Asana, and don't want to give it long-term middleman access. Follow instructions on https://app.asana.com/-/developer_console.
  5. Add this PAT to the local config
    echo 'pat: "your_private_access_token_here"' >> config.yaml 
  6. Add the Asana workspace to the local config (this is required for webhooks.get_all). You could get workspace id from url in admin console of Asana UI.
    echo 'workspace: your_workspace_id_here' >> config.yaml 
  7. Run ./webhook_server.py. This will block, so do this in a separate terminal window.
  8. Request Asana to create webhook
    ./asana-cli.py webhooks create --target 'https://SUBDOMAIN_HERE.ngrok.io/receive-webhook?project=PROJECT_ID' --resource PROJECT_ID
  9. Make changes in Asana and see the logs from the returned webhooks.
  10. Don't forget to deauthorize your temp PAT when you're done.

asana2rabbitmq

This is an extension of the asana studies that were described above. Please familiarize yourself with them before continue.

  1. Acquire running RabbitMQ instance.
  2. Add amqp_url: amqps://login:passwod@host:port entry to config.json.
  3. Run ./asana2rabbitmq.py
  4. Register webhook via asana-cli.py
  5. Run ./listen.py --queue task_changes and ./listen.py --queue comments. This will block, so do this in a separate terminal windows.

About

Getting to know Asana webhooks API and building simple bot that listens for Asana comments and publishes them to RabbitMQ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages