HTTP authentication

Eric Krasner - US 61 Reputation points

I am trying to do an outbound http call to Freshservice. It requires basic authorization, but it only uses an api key. Below is the code I use when I do this in PowerShell. How do I replicate this in Logic Apps.

PoweShell code:
$APIKey = 'xyz'
$EncodedCredentials = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $APIKey,$null)))
$HTTPHeaders = @{}
$HTTPHeaders.Add('Authorization', ("Basic {0}" -f $EncodedCredentials))
$HTTPHeaders.Add('Content-Type', 'application/json')

This is what I have tried, but I get:
"code": "access_denied",
"message": "You are not authorized to perform this action."


Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,988 questions
{count} votes

Accepted answer
  1. Bruno Lucas 4,421 Reputation points MVP

    Hi ,
    This worked for me:

    according to their doc, auth is basic (

    one good trick to help is importing the curl in postman

    I noticed postman converted into an authorization header that ignores the password, only the work Basic followed by the key. somehow works. the password is made up anyway according to the doc



    update worked just as well:


    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,991 Reputation points

    @Eric Krasner - US Adding more to @Bruno Lucas answer and for the community reference.
    In case someone wants to use the base64 encoding then they can leverage the base64 logic app function.
    You can always refer to this workflow expression functions in Azure Logic Apps document that has the list of supported expression functions.


    **Note: ** The above is only for reference purposes where I have hardcoded the string value, but you can modify it according to your input value or as per your requirement.

    0 comments No comments