Zapier

=== Using Zapier Without the Habitica Zapier Integration ===
In addition to using the Habitica app on Zapier, it is also possible for Zapier to interact with Habitica by using its "Webhooks" app to contact Habitica's Application Programming Interface.
This can potentially allow Zapier users to take actions not included in the Zapier Habitica app. For example, see The Keep:Scheduling Quest Starts with Zapier and API, which describes the use of Zapier's Google Calendar and Webhooks apps to start Quests automatically using API's "quests/force-start" call.
=== Tips & Tricks ===
==== General ====
* Because Zapier fetches data periodically (every 5 to 15 minutes), guild/party chats may appear out of order if two or more chat messages get posted during that time. For example, a 12:54pm message may be fetched before a 12:51pm message.
* When creating tasks, the Due Date needs to be changed to the UTC time zone in order to appear correctly on the website.
* Currently, the Due Date for Create Tasks is not populating correctly for the app (but will show correctly on the website). To fix this, just update the date manually.
* When using the Task Activity as a Trigger, in the "Test this Step" complete an action that most represents what you wish to collect, to have the ideal flags available. For instance, if you wish record when you completed your dailies and the streak is, complete a daily task so you are able to select the streak tag option.
* Zapier currently does not record activity due to cron, ie the effect of miss dailies. You will only know if you have missed a daily when you next complete (score) the daily and when checking if the streak is 1 or not.
* Zapier does not support two-way syncing. Thus, keeping records up to date after the initial Trigger and Action is not currently supported. Think of Zaps as one-way, one-time actions. For more information, see this official article from Zapier.
==== Google Sheets ====
* Google Sheets must:
** have a header record on the first row
** not have any blank rows between any records
* Times in Habitica are stored in Epoch time. To show correctly in Google Sheets, use the appropriate time-date formatting and:
** To convert to UTC, add ts in front of the Time field. For example, ts[Habitica Timestamp]. Note: no equal sign is used.
** To convert to your local time, use =[Habitica Timestamp]/86400000+"1 Jan 1970"+[GMT Adjustment]/24, where the [GMT Adjustment] is the number of hours ahead of or behind GMT. For example, PDT is GMT -7, so the formula will be =[Habitica Timestamp]/86400000+"1 Jan 1970" + -7/24.
* When using Create Task Action to convert Due Dates to the correct UTC format, use the following formula: =[Excel Field with Date]+([GMT Adjustment]/24). For example, if the time zone is PDT (GMT -7) and the date field is in C2, then the formula will be =C2+(-7/24)
=== Samples ===
==== Copy Party/Guild Chat into Google Sheets ====
# Create a Google Sheet with the column headings you wish to capture, like Name, Level, Timedatestamp, and Text.
# Format the Timedatestamp field using the appropriate time-date formatting.
# Go to the Zapier Dashboard. Choose Make a Zap.
# Choose Habitica as the Trigger App.
# Choose New Group Chat and Save + Continue.
# If not already completed, choose Connect to New Account and fill out your UID and API Token, which can be found on the Habitica website via Settings > API.
# Select the account and click Save + Continue.
# Select either your party or a guild and click Continue.
# Click Connect & Continue.
# In the guild or party enter one line of chat.
# You should get a message saying, "Test Successful!". This will hang till a new chat lines appears. You can see the results by clicking View Your Chat, which will display the last line in the guild. Click Continue.
# Choose Google Sheets as your action.
# Choose Create Spreadsheet Row.
# If not already completed, choose Connect to New Account and fill out your Google username and password.
# Select the Account and click Save + Continue.
# Select the Spreadsheet and appropriate Worksheet.
# Fill out Column Details: (These columns may not appear in the same order)
#* Date/time: =[Step 1 Timestamp]/86400000+"1 Jan 1970" + -7/24 for PDT(GMT-7). Please see Tips & Tricks For Google Sheets for more about formatting timestamps.
#* Name: [Step 1 User Name]
#* Level: [Step 1 Contributor Level]: [Step 1 Contributor Text]
#* Text: [Step 1 Text]
# Click Continue.
# You can Test Google Sheets by inserting the last line of chat into your spreadsheet. Click Create & Continue.
# You should get a message saying, "Test Successful!" If you do not, please check that there are no blank rows between any records.
# Open your spreadsheets and review your results.
#* The first row may read, "Added by Zapier, ensuring we can access this spreadsheet. Feel free to delete it after you are all set up!" You can delete this row. (Do not just clear the content, but remove the entire row; otherwise, your Zap will stop populating!)
#* The next line will be the automatically entered line of chat.
# Click Finish.
# Name your Zap and click Your Zap Is On for it to start collecting data.
==== Load New To Do's from Google Sheets ====
This method shows how to load To Do's when a new row is created. Therefore if there is already an existing list, or if you wish to edit the To Do's before uploading, edit in a separate document first, and then paste the row into a Google Sheet once the Zap is on.
# Create a Google Sheet with the following headings: Task Name, Notes, Actual Due Date, UTC Due Date.
# Format the Due Date fields with appropriate time-date formatting.
# Fill out the Task Name, Notes and Actual Due Date. Only add one To Do row as subsequent rows will be ignored and not loaded. Add these tasks after creating the Zap.
# In the UTC Due Date Field, use =C2+(-7/24) for PDT(GMT-7).
# Go to the Zapier Dashboard. Choose Make a Zap.
# Choose Google Sheets as the Trigger App.
# Choose the Trigger as New Spreadsheet Row and click Save + Continue.
# If not already completed, choose Connect to New Account and fill out your Google username and password.
# Select the Account and choose Save + Continue.
# Select the Spreadsheet and appropriate Worksheet and click Continue.
# Click Fetch & Continue to confirm that it is able to read one task.
# You can view the spreadsheet row to confirm the data is correct. Click Continue once done.
# Choose Habitica as the Action App.
# Choose Create Task as your option and click Save + Continue
# If not already completed, Choose Connect to New Account and fill out your UID and API Token which can be found on the Habitica website via Settings > API.
# Select the account and click Save + Continue.
# Fill out Column Details:
#* Type: To Do
#* Task: [Step 1 taskname]
#* Notes: [Step 1 notes]
#* Due Date: [Step 1 utcduedate]
# Click Continue.
# Review it is correct and click Create & Continue
# Sync your Habitica Account on the App or Website and review your new task.
# Click Finish.
# Name your Zap and click Your Zap Is On.
# Add new rows for new To Do's as desired, ensuring the UTC Due Date column is populated appropriately.
==== Add Completed Tasks to Your RescueTime ====
A premium RescueTime account is required for this (direct link).
# Go to the Zapier Dashboard. Choose Make a Zap.
# Choose Habitica as the Trigger App.
# Choose Task Activity, click Save + Continue.
# If not already completed, Choose Connect to New Account and fill out your UID and API Token which can be found on the Habitica website via Settings > API.
# Select the account and click Save + Continue.
# Select Yes to Scored, and No to all other options
# Click Connect + Continue
# Click a task so the Test is Successful appears. Click Continue.
# Choose RescueTime as the Action App.
# Choose Log a Highlight Event. Click Save + Continue.
# If not already completed, choose connect to new account and fill out your RescueTime username and password.
# Select the Account and click Save + Continue.
# Fill out Column Details:
#* Date/Time: [Step 1 Updated At]
#* Description: [Step 1 Task Text] was scored [Step 1 Direction]. Completion: [Step 1 Task Completed]
#* Action Label: Habitica
# Click Continue.
# Review it is correct and click Create & Continue.
# Click Finish.
# Name your Zap and click Your Zap Is On.
=== Beta Version Development ===
If you would like to assist with development of the beta version, please see the GitHub repository at HabitRPG/habitica-zapier and join the Aspiring Zapier Comrades guild. You can ask questions there and hopefully get answers!
=== See Also ===
* Zapier Integration - Habitica's official blog post from August 2019. This link is provided for historical reasons. The information in the blog post may not still be correct and should not be used to learn how to use the integration.
fr:Zapier
ja:Zapier
Category:Extensions, Add-Ons, and Customizations
Category:Pages with files missing alt tags