1

How to form the JSON for Basic Authentication for billPlz api? It is said in the API Reference of BillPlz that- "You authenticate to the Billplz API by providing your API Secret Keys in the request. You can get your API keys from your account’s settings page.

Authentication to the API occurs via HTTP Basic Auth. Provide your API key as the basic auth username. You do not need to provide a password."

How do I do it if I want to form a raw JSON and send it to the header?

Sami Al-Jabar
  • 151
  • 2
  • 9

1 Answers1

0

Here is the JSON to be formed for the header part:

{ 
  "Authorization":"Basic {username}"
}

According to the api reference of billPlz, it is said that api-key has to be sent as the username and password is not required. But You cannot directly place the api key in place of username. It is needed to be converted to base64 and then place that converted one in place of username (without curly braces of course) mentioned above.

Sami Al-Jabar
  • 151
  • 2
  • 9