Authenticating with JWTs in a ticketing workflow Web Service Step
I'm trying to set up a workflow that calls the TD Web API to automate some tasks, but I'm having trouble getting the web service calls to authenticate - they keep failing with a 401 Unauthorized, and the logs say "Unable to authenticate".
I've got a Workflow Web Service Account created (set as TeamDynamix Web API authentication type), with a username and password entered, but I'm not sure how that's actually used to authenticate with the API. Does it include the JWT automatically in the HTTP headers for workflow steps using that authentication, or should I be handling that myself?
Answers (3)
My apologies for the confusion, Jackson. To authenticate against the TD API in a workflow, you will first need to create a workflow web service account in the Admin application. You can find this by going to Admin > Ticketing Applications > Select the application your workflow is associated with > Workflow Web Service Accounts > New. From here you can add a username and password that you use to login to the API.
The next step is to associate that account with a workflow web service. To do this, go to Admin > Ticketing Applications > Select the application your workflow is associated with > Workflow Web Services > New. From here you can set the base URL and select the account you just created from the "Authentication Account" dropdown.
You can now associate that web service with your ticket workflow steps, and all authentication will be taken care of for you by the workflow process itself. Again, my apologies for any initial confusion. Let me know if this helps. If you have any additional questions, feel free to email me at phillip.curl@teamdynamix.com.
Sincerely,
Phil Curl
TeamDynamix
Hi Phil,
Thanks for the documentation, but I'm still a little confused. I understand how to authenticate with the TD Web API, but I don't know how to authenticate against the TD API in web service steps inside a ticketing workflow. Maybe I've got the wrong idea of what the ticketing workflow Web Service Accounts are used for?
Hi Jackson,
In short, you should be including the JWT as an "Authorization" header (of type "Bearer") in all subsequent API calls following your initial authentication request. The following Knowledge Base article provides a nice summary of authenticating with the API: https://solutions.teamdynamix.com/TDClient/KB/ArticleDet?ID=1715 . You can also find authentication-specific documentation for the API here: https://api.teamdynamix.com/TDWebApi/Home/section/Auth . I hope this helps. If you have any additional questions, just let us know and we will be happy to help.
Sincerely,
Phil Curl
TeamDynamix