From daa722ba0f0f91ef733add25cdae4f4001434342 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Sun, 15 Mar 2020 16:09:58 +1100 Subject: [PATCH] Rename `ApiKey` to `ApiToken` to match the terminology Zendesk doco uses `ApiKey` added as an alias for backward compatibility. --- functions/Connect-.ps1 | 5 +++-- functions/Get-Connection.ps1 | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/functions/Connect-.ps1 b/functions/Connect-.ps1 index bfe33cd..77d2681 100644 --- a/functions/Connect-.ps1 +++ b/functions/Connect-.ps1 @@ -26,11 +26,12 @@ function Connect- { [String] $Username, - # Zendesk API key retrieved from https://.zendesk.com/agent/admin/api/settings + # Zendesk API token retrieved from https://.zendesk.com/agent/admin/api/settings [Parameter(Mandatory = $true)] + [Alias('ApiKey')] [ValidateNotNullOrEmpty()] [SecureString] - $ApiKey + $ApiToken ) $Script:Context = Get-Connection @PSBoundParameters diff --git a/functions/Get-Connection.ps1 b/functions/Get-Connection.ps1 index 2bd5845..4577791 100644 --- a/functions/Get-Connection.ps1 +++ b/functions/Get-Connection.ps1 @@ -25,17 +25,18 @@ function Get-Connection { [String] $Username, - # Zendesk API key retrieved from https://.zendesk.com/agent/admin/api/settings + # Zendesk API token retrieved from https://.zendesk.com/agent/admin/api/settings [Parameter(Mandatory = $true)] + [Alias('ApiKey')] [ValidateNotNullOrEmpty()] [SecureString] - $ApiKey + $ApiToken ) $context = [PSCustomObject]@{ Organization = $Organization BaseUrl = "https://$Organization.zendesk.com" - Credential = [System.Management.Automation.PSCredential]::New("$Username/token", $ApiKey) + Credential = [System.Management.Automation.PSCredential]::New("$Username/token", $ApiToken) User = $null }