Hello,
i need a code example for an API Call in Powershell. I am new and not sure how to create a correct API call with authentication.
I have created an API Key and a Client Secret.
It would be nice to create an example for a call of all projects.
I thought about using the Invoke-RestMethod of Powershell (Invoke-RestMethod (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn) near to this:
$headers = @{
Authorization: Bearer {api_key}
}
Invoke-RestMethod -Uri "https://api.awork.com/api/v1/projects" -Method Get -Headers $headers
I need an fully functional example for orientation.
Thanks!