Help needed using Custom Credential value in Webhook Notification Header

Hello,
I am trying to use a value from a Custom Credential Type in a Webhook Notification header, but nothing I am trying works.

Scenario:
Custom Credential Type = Webhook Keys with the following definition:
“inputs”: {
“fields”: [
{
“id”: “App_API_username”,
“type”: “string”,
“label”: “API_Username”
},
{
“id”: “App_API_Key”,
“type”: “string”,
“label”: “API_Key”,
“secret”: true
}
]
},
“injectors”: {
“extra_vars”: {
“App_API_Key”: “{{ App_API_Key }}”,
“App_API_USERNAME”: “{{ App_API_username }}”
}
}

I have created the following Credential using that custom type:
“name”: “Dev API Key”
“inputs”: {
“App_API_Key”: “$encrypted$”,
“App_API_username”: “”
},

What I am having a hard time figuring out is how to get the App_API_Key value for that credential into a Webhook Notification header:

{
“content-type”: “application/json”,
“key”: “{this is where I need the value from the credential}
}

Any ideas on how I can accomplish this?

JT

If I’m understanding what you’ve said correctly. It would be App_API_Key.

Assuming in AWX you have your Job Template and you’ve created a Credential from the custom Credential Type and associated it with the Job Template, in your playbook:

---
- hosts: localhost
  tasks:
    - ansible.builtin.uri:
      url: https://some-webhook-service.example.tld
      headers:
        key: "{{ App_API_Key }}"

I need it in a Webhook Notification header, not in a playbook.

The closest I’ve found in 4 days of google/documentation searching is:
{{ ‘Dev API Key’ | App_API_Key(‘App_API_Key’) }}

But the filter App_API_Key is not built-in, and not recognized. I don’t know what filter to use for a customer credential type.

The only thing left I can think to try is use the Custom Credential type name as the filter, but I suspect I would need to remove the space in it.

OK, you’re configuring a Notification Template with the Webhook type. That wasn’t clear to me in your initial post.

I don’t know of any way to access a Credential within a Notification Template. I don’t think it’s possible. The AWX Community documentation shows an example with an Authentication header having the value directly.

Yep, I’ve been all over the docs. Here is another suggestion Google came up with:

{
      "Authorization": "Basic {{ '{{' }} MyWebhookAuth.username {{ '}}' }}:{{ '{{' }} MyWebhookAuth.password {{ '}}' }} | b64encode }}"
}

But so far it’s not working using my values.