Authentication to an external API

hello everybody,
I am using Jira Service Management installed on a server. I need to send information to an external API when a ticket is closed. For doing that I need to use another API for getting the token to access the external API.
I’m wondering how to do that. I was thinking to install ScriptRunner app, but I’m looking for other methods, preferably using a functionalities already present in Jira software, but I think that it is not possible.
Thanks in advance,
Josip