Freshdesk API Key Base64 Encoding

Freshdesk API Key Base64 Encoding Setup

Converting a Freshdesk API Key so it gets accepted for authentication purposes.

Challenge: Freshdesk API Authentication

If you want to pull reports from Freshdesk or modify tickets remotely, the best way to do this is via Freshdesk API. The interface expects the corresponding authorization via the Authentication HTTP header. The format appears straight forward:

"Authorization" : Basic [Your API Key here]

However, the interface expects the API key to be Base64-encoded. For analysts and Excel users it is not always easy to ensure this encoding in their processes. Accordingly, here are three ways you can use to encode your Freshdesk API Key Base64 without resorting to fancy software engineering setups.

By the way, you can get your Freshdesk API key under Profile Settings > API Keys > View API Key.

Freshdesk API Key Interface

1 | Online Base64 Encoder

There are some online Base64 encoders or decoders out there. There is Base64Encode.org or base64.guru – just to name two. You open the websites, copy your API key into the input field and further down the page you get the result. It’s very simple and you don’t need to install extra software for a process you might only have to do once.

Base64 Encode Org

But: Remember that you are sending credentials to an unknown developer of online software! This could already be forbidden, if not even threatening, within your organization. If the whole thing is too sketchy for you, you still have options 2 and 3.

2 | Power Automate Desktop Base64 Encoding

If you haven’t installed Power Automate Desktop yet, you should do so via the Microsoft Store or the Web – it’s a useful tool. First create a new .txt document on your PC and copy your Freshdesk API Key into it. Then create an “API Key to Base64” flow. In this flow you only need a manual trigger and a step called Convert File to Base64 from the library. Put the path to your .txt file in there and run the flow.

Power Automate Base64 Encode Step

So you get a base64-encoded API key in the output variable. (I made up the API key for encoding, so the following result will be useless for readers).

Power Automate Base64 Encode Result

With this setup you can now do more exciting things in Power Automate with the result. For example, you can now have the Base64 API key written back to your disk as a file, or you can have the key generated on the fly during an API call flow.

3 | Excel Base64 Encoding

Almost every business user has Microsoft Excel on his computer. Excel, as for many things, is also suitable for base64 encoding your Freshdesk API key. First of all: There is no standard formula to convert the key from cell to cell. But there is an Encode() VBA function that you can easily utilize for your purposes.

Create a new VBA module in Excel that looks something like this:

Function EncodeBase64(keyInput As String) As String
  'make sure Microsoft XML V6.0 is checked in the references'
  Dim keyArray() As Byte: keyArray = StrConv(keyInput, vbFromUnicode)
  Dim keyAsXML As MSXML2.DOMDocument60

  Set keyAsXML = New MSXML2.DOMDocument60
  With keyAsXML.createElement("bas64key")
    .DataType = "bin.base64"
    .nodeTypedValue = keyArray
    EncodeBase64 = .Text
  End With
End Function

Make sure the Microsoft XML V6.0 module in the references section is checked.

excel vba references tab

Use the newly developed EncodeBase64() function in a sheet to convert the key.

Excel Base64 Encode function

Have fun with your Freshdesk API Authentication

Now that you have a Base64-encoded API key, nothing stands in the way of your collaboration with the Freshdesk API. So have fun and happy reporting.

You need help within your Freshdesk reporting infrastructure?

Then feel free to write a comment below this post! I try to answer questions within a couple of days. If you have more urgent issues, internetzkidz.de recommends a request to THE BIG C Agency – an agency specialized in developing reporting infrastructures for startups and SMEs.

Christoph Kleine
Christoph Kleine

... is Managing Director at THE BIG C Agency & founder of internetzkidz.de. Besides Online Marketing he works on issues of Usability, Web-Analytics, Marketing-Controlling and Business Development. Xing, LinkedIn.

Articles: 463

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.