Skip to content

Commit

Permalink
Merge pull request #36 from Readify/api-token
Browse files Browse the repository at this point in the history
Rename `ApiKey` to `ApiToken` to match the terminology Zendesk doco uses
  • Loading branch information
RobFaie authored Mar 22, 2020
2 parents 92c01a9 + daa722b commit d37ce8d
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 @@ -25,11 +25,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 d37ce8d

Please sign in to comment.