This is a Developer task
The Rest API now offers Basic Authentication (Basic Access Authentication) as an authentication method.
The authentication header should be sent with every request with the schema set to Basic followed by the parameters and signature as below.
Authorization: Basic (Base64 Encoded(<<AppId>>:<<APIKey>>))
The authorization header is generated using the following steps.
- The AppId and APIkey are combined with a single colon (:).
- eg. "a55dc6aa-30ef-4b9a-bba8-afa001315072:9uIiAWiDssv7B8k7AqVOFnul27qwjsViBhIA2v4DBmI6"
- The resulting string is encoded into an octet sequence using ASCII Encoding.
- The resulting string is encoded using Base64.
- The authorization method and a space (e.g. "Basic ") is then prepended to the encoded string.
PowerShell Example
# Example Appid: a55dc6aa-30ef-4b9a-bba8-afa001315072
# Example APIKey: 9uIiAWiDssv7B8k7AqVOFnul27qwjsViBhIA2v4DBmI6
# Create the string (AppId:APIKey) and generate the octet sequence.
$basicbytes = [System.Text.Encoding]::ASCII.GetBytes(
'a55dc6aa-30ef-4b9a-bba8-afa001315072:9uIiAWiDssv7B8k7AqVOFnul27qwjsViBhIA2v4DBmI6')
# Encode the octet sequence to Base64.
$basicbase64 = [Convert]::ToBase64String($basicbytes)
# Complete the header value.
$basicvalue = "Basic "+$basicbase64
# Create a new Header object.
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
# Add the Authorization Header to the Header object.
$headers.Add("Authorization", $basicvalue )