_
Summary
- Create the External Metrics
- Create the API Token
- Enable updates via API
- Create the Contest
- Script to update the Contest
- View Update Logs
_
Business Purpose
Crewhu + Hudu integration allows you to measure and reward your team for hitting documentation goals, using contests based on the metrics that you want to track:
- Documents created
- Documents viewed
_
Creating the External Metrics
In Crewhu click the "External Metrics" option in the "Gamification" section on the menu to the left:
_
Add a metric for "Hudu Docs Viewed"
Click the "+Add" button at the top right corner and fill out the form:
We suggest using "hududocsviewed" for the "Metric Code" to avoid the need to edit the POST script. See the example below:
Click the "Save" button at the top right corner.
_
Add a metric for "Hudu Docs Created"
Click the "+Add" button at the top right corner and fill out the form:
We suggest using "hududocscreated" for the "Metric Code" to avoid the need to edit the POST script. See the example below:
To learn more about this form, refer to our External Metrics article.
_
Creating an API token
In Crewhu, expand the "General" item and click the "Integrations" option inside the "Settings" section on the menu to the left:
Flag the "Open API" checkbox to enable access:
Click the "+Add" button:
On the pop-up, enter the integration name, flag "Active", and click "Confirm":
Click "Save" at the top right corner to display the new API token on the list:
_
Enabling contest updates via API
In Crewhu, expand the "Gamification" item and click the "Contests" option inside the "Settings" section on the menu to the left:
Flag the "Contests Update via API" checkbox:
Select Crewhu users to receive notification via email in case of an error on the API call:
_
Creating the Contest
In Crewhu click the "Contests" option in the "Gamification" section on the menu to the left:
Click the "+Add" button at the top right corner, choose "External Metrics" as the source, and select the metric you wish to gamify on this contest:
To learn more about the Contests form, refer to our Gamification: SMART Contests article.
_
Script to update the contest
This script was written by one of our customers who is a Hudu user and kindly shared it with us. For this reason, you might have to adapt it to your necessities.
Click the link below to copy the script:
https://github.com/crewhu/public_scripts
Note from the author:
The script when run will then update the contest for the period the contest lasts. It will replace any other values that were already in the contest, so I recommend you just run it shortly before the end of the contest. The script is set up for a weekly contest, but you can change this by altering the add days setting in the “#Get Hudu Data” section.
Adjust the days count and timeframe code accordingly to the contest you wish to update:
- DY: Daily
- WK: Weekly
- MO: Monthly
- QT: Quarterly
- YR: Yearly
_
Contests Update
To view the update logs, in Crewhu, expand the "Gamification" item and click the "Contests" option inside the "Settings" section on the menu to the left:
Click the "View Updates Log" at the top right corner. This list will provide you with the timestamp of the call, its status, the name of the contest updated when successful, the reason for the error when failed, and the Crewhu API Token called.
These are the possible error messages:
-
Metric token param not identified
- Double-check if the metric code used on the script matches the one on the external metric form:
- Double-check if the timeframe informed on the script matches the one on the Contest:
- DY: Daily
- WK: Weekly
- MO: Monthly
- QT: Quarterly
-
YR: Yearly
- Double-check if the metric code used on the script matches the one on the external metric form:
-
External Metric not found
- Confirm if the External Metric is active;
- Double-check if the metric code used on the script matches the one on the external metric form.
-
No matches in the CSV file
- The user IDs on the results don't match the users in Crewhu:
- Confirm if the users are active;
- Confirm if the ID used in Hudu and Crewhu are the same.
- The user IDs on the results don't match the users in Crewhu:
-
Update Contest via API is Off
- Enable the updates via API. Click here to see the instructions.
Comments
0 comments
Article is closed for comments.