Step 4: Maintain Your Taxonomy Using a Plugin
Before You Start
Now that your doctors have their specialties assigned, you may not want to maintain both a Listings category and a taxonomy specialty for each healthcare professional entity. To manage this, you can download a plugin to automatically maintain parity between your doctors’ categories and taxonomy specialties.
Every time you create a new healthcare professional entity (or edit an existing one), this plugin will check the Categories and/or Related Specialties field and ensure that they match.
The plugin contains three functions which you can choose between based on your use case:
- Category to Specialty: every time you update a Listings category on a doctor profile, the corresponding specialty linked to that doctor will change accordingly.
- Specialty to Category: every time you update a taxonomy specialty on a doctor profile, the corresponding category linked to that doctor will change accordingly.
- Bidirectional: every time you update either a taxonomy specialty or a Listings category on a doctor profile, the corresponding category or specialty will update accordingly.
Steps to Install
- Navigate to Developer > Developer Console.
- In the top right corner, click + Add an App
- Name your app (something like “Maintaining Taxonomy Specialties”). Click Create App.
- Under the API Credentials tab, add an API Permission for the Management API > Entities endpoint. Under Permissions, select Read/Write. Click Save, and then confirm by clicking Change Permissions.
- On the same page, click the eye symbol to view the API Key related to your new app. Copy this API Key down, as you will use it soon.
- Navigate to this GitHub repository.
- Click the green <> Code button and then select Download ZIP.
- On your computer, unzip the file and save the folder.
- Open up your command line interface (Command Prompt for Windows, Terminal for Mac.)
- Type in the following command:
yext init
- If you have connected to this Yext account via CLI before, select Use existing credential and select the account that hosts taxonomy data. Otherwise, select Create new credentials and input the business ID for the account where you downloaded the taxonomy solution.
- You will need to authorize your account if you haven’t used the CLI recently. A window will pop up in your browser. Click Authorize in this window.
- Return to the command line interface, and select Yes.
- Type in the following command:
yext resources apply/filepath
, replacingfilepath
with the file path where you saved your GitHub files in Step 8.- For example, if you saved the resources in your
Documents
folder, type inyext resources apply /Documents/maintainingTaxonomySpecialties-main
- For example, if you saved the resources in your
- When asked to confirm whether you’d like to add these resources to your account, select Yes.
- You will then be prompted to input the API Key you generated in Step 5 above. Paste it in the CLI and click Return.
- Close the CLI and open your Yext account.
- Navigate back to the app you created in Step 3, and select the Webhooks tab. Click + Add a Webhook.
- Under Select Webhook Type, choose Entities. Click Next.
- Give your webhook a name (something like “Taxonomy Updates”), and provide a description if you choose.
- Beneath URL, click … or invoke a function. From the dropdown, select maintainingTaxonomy, and then choose the function you’d like to implement based on the options detailed at the top of this step.
- In the bottom right corner, select Finish and Add.
You can now test your newly installed plugin by changing a specialty or Listings category on one of your doctor entities. Once you’ve changed the field, refresh the page and make sure that the corresponding category or specialty has been updated.