<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Alert API key owners about the API key expiration within x days in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Alert-API-key-owners-about-the-API-key-expiration-within-x-days/ta-p/1972828</link>
    <description>&lt;P&gt;This article contains additional information on the "Alerts API key owners about API key expiring within x days" template. You can find this template in the template picker when creating new automation.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This template will send an alert email to API key owners with a list of API keys that are expiring within x days or that have expired or been revoked. It can also alert all tenant admins via email with a list of API keys that have been orphaned by the deletion of their owner's account.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For example, if we want to know the API keys that are expired/have been revoked and are expiring within 10 days, we can use this template which retrieves the information and sends an email to the respective users/tenant admins.&lt;/P&gt;
&lt;P&gt;Steps to set up the values in the template:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Set the value for the variable &lt;STRONG&gt;APIKeyExpiresWithinDays&lt;/STRONG&gt; which specifies the API keys that will be expiring or have expired/have been revoked for 'x' num of days. Where x is a number set in this variable.&lt;/LI&gt;
&lt;LI&gt;Set the value for the variable &lt;STRONG&gt;EmailTenantAdmins&lt;/STRONG&gt; which allows to Email all tenant admins the list of API keys orphaned by&amp;nbsp;&lt;SPAN&gt;the deletion of their owner's account.&lt;/SPAN&gt;&amp;nbsp;The value can be Yes/No.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Automation structure&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Retrieve all the users using the &lt;STRONG&gt;List Users&amp;nbsp;&lt;/STRONG&gt;block and store them in the variable.&lt;/LI&gt;
&lt;LI&gt;Retrieve all the API keys using the Raw API List Request block and store them in the variable named API keys.&lt;/LI&gt;
&lt;LI&gt;Loop over each API key in the APIKeys object and check if&amp;nbsp;the API key is expiring within the set number of days ("APIKeyExpiresWithinDays").&lt;/LI&gt;
&lt;LI&gt;If the API keys are found, then store them in the variable UserAPIKeys.
&lt;UL&gt;
&lt;LI&gt;Retrieve the tenant information using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Get Current Tenant Info&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;block and store the tenant URL in the tenantURL variable.&lt;/LI&gt;
&lt;LI&gt;Loop over the UserAPIKeys and check if the user is tenantAdmin and&amp;nbsp;&lt;SPAN&gt;pick the username and user email of the API key owner to send an email.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Construct the email body using the above information and send an email to the owner of the API key.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Below is the image of the email received.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/87674iD3083956B7465821/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot.PNG" alt="screenshot.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 12:17:31 GMT</pubDate>
    <dc:creator>Madhushree_BP</dc:creator>
    <dc:date>2022-09-13T12:17:31Z</dc:date>
    <item>
      <title>Alert API key owners about the API key expiration within x days</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Alert-API-key-owners-about-the-API-key-expiration-within-x-days/ta-p/1972828</link>
      <description>&lt;P&gt;This article contains additional information on the "Alerts API key owners about API key expiring within x days" template. You can find this template in the template picker when creating new automation.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This template will send an alert email to API key owners with a list of API keys that are expiring within x days or that have expired or been revoked. It can also alert all tenant admins via email with a list of API keys that have been orphaned by the deletion of their owner's account.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For example, if we want to know the API keys that are expired/have been revoked and are expiring within 10 days, we can use this template which retrieves the information and sends an email to the respective users/tenant admins.&lt;/P&gt;
&lt;P&gt;Steps to set up the values in the template:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Set the value for the variable &lt;STRONG&gt;APIKeyExpiresWithinDays&lt;/STRONG&gt; which specifies the API keys that will be expiring or have expired/have been revoked for 'x' num of days. Where x is a number set in this variable.&lt;/LI&gt;
&lt;LI&gt;Set the value for the variable &lt;STRONG&gt;EmailTenantAdmins&lt;/STRONG&gt; which allows to Email all tenant admins the list of API keys orphaned by&amp;nbsp;&lt;SPAN&gt;the deletion of their owner's account.&lt;/SPAN&gt;&amp;nbsp;The value can be Yes/No.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Automation structure&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Retrieve all the users using the &lt;STRONG&gt;List Users&amp;nbsp;&lt;/STRONG&gt;block and store them in the variable.&lt;/LI&gt;
&lt;LI&gt;Retrieve all the API keys using the Raw API List Request block and store them in the variable named API keys.&lt;/LI&gt;
&lt;LI&gt;Loop over each API key in the APIKeys object and check if&amp;nbsp;the API key is expiring within the set number of days ("APIKeyExpiresWithinDays").&lt;/LI&gt;
&lt;LI&gt;If the API keys are found, then store them in the variable UserAPIKeys.
&lt;UL&gt;
&lt;LI&gt;Retrieve the tenant information using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Get Current Tenant Info&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;block and store the tenant URL in the tenantURL variable.&lt;/LI&gt;
&lt;LI&gt;Loop over the UserAPIKeys and check if the user is tenantAdmin and&amp;nbsp;&lt;SPAN&gt;pick the username and user email of the API key owner to send an email.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Construct the email body using the above information and send an email to the owner of the API key.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Below is the image of the email received.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/87674iD3083956B7465821/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot.PNG" alt="screenshot.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 12:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Alert-API-key-owners-about-the-API-key-expiration-within-x-days/ta-p/1972828</guid>
      <dc:creator>Madhushree_BP</dc:creator>
      <dc:date>2022-09-13T12:17:31Z</dc:date>
    </item>
  </channel>
</rss>

