Forum Discussion
API auth - Use parameter instead of Data Source Setting GUI
- 2 years ago
change your data source settings to anonymous auth.
RelativePath must be only "tickets"
Usually an APIKey is part of the URL but consult the documentation of your API for the details. Spacing is important so use
Headers=[Authorization="Basic " & FreshserviceAuthHeader]Thanks for your help. I went back to the API documentation and found this article detailing how to connect via powershell.
Running that powershell script with the Base64 key works (and i can get data from the API).
$credPair = "<your-freshservice-api-token>:.";
$encodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($credPair));
$headers = @{ Authorization = "Basic $encodedCredentials" };
$url = "https://<your-subdomain>.freshservice.com/api/v2/tickets/1?include=assets";
$Response = Invoke-WebRequest -Uri $url -Method Get -Headers $headers -UseBasicParsing;
$Response.Content;
The format for the headers line matches what you suggested and what i have in my query but i get the following error:
- lbendlin2 years ago
Super User
Show the definition of FreshServiceBaseURL
- MyThumbsClick2 years ago
Helper II
I have tested omitting the variable, instead inserting the API straight into the query like below but no dice.
Headers=[Authorization="Basic <Base64encoded APIKEY>)"]The value of the Parameter is:
Basic <Base64encoded API Key>- lbendlin2 years ago
Super User
is that extra parenthesis a typo?