Skip to content

Commit

Permalink
Rename ApiKey to ApiToken to match the terminology Zendesk doco uses
Browse files Browse the repository at this point in the history
`ApiKey` added as an alias for backward compatibility.
  • Loading branch information
RobFaie committed Mar 15, 2020
1 parent cc154c7 commit daa722b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions functions/Connect-.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ function Connect- {
[String]
$Username,

# Zendesk API key retrieved from https://<organization>.zendesk.com/agent/admin/api/settings
# Zendesk API token retrieved from https://<organization>.zendesk.com/agent/admin/api/settings
[Parameter(Mandatory = $true)]
[Alias('ApiKey')]
[ValidateNotNullOrEmpty()]
[SecureString]
$ApiKey
$ApiToken
)

$Script:Context = Get-Connection @PSBoundParameters
Expand Down
7 changes: 4 additions & 3 deletions functions/Get-Connection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ function Get-Connection {
[String]
$Username,

# Zendesk API key retrieved from https://<organization>.zendesk.com/agent/admin/api/settings
# Zendesk API token retrieved from https://<organization>.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
}

Expand Down

0 comments on commit daa722b

Please sign in to comment.