When making a POST request, you are to do a SHA256 encryption of the reference in your request payload before making the request. You'll need your public key (found in the Settings > API keys section of your dashboard) to manually encrypt the reference passed in the payload of the request. You can make use of this SHA 256 Hashing tool or any other of your choice for your encryption for your POST requests.
const crypto = require('crypto');
function generateSignature(publicKey, reference) {
const concatenatedString = publicKey + reference;
const hashedString = crypto.createHash('sha256').update(concatenatedString).digest('hex');
return hashedString;
}
// Example Usage
const publicKey = "your_public_key";
const reference = "your_reference";
const signature = generateSignature(publicKey, reference);
console.log(signature);
import hashlib
def generate_signature(public_key, reference):
concatenated_string = public_key + reference
hashed_string = hashlib.sha256(concatenated_string.encode()).hexdigest()
return hashed_string
# Example Usage
public_key = "your_public_key"
reference = "your_reference"
signature = generate_signature(public_key, reference)
print(signature)
require 'digest'
def generate_signature(public_key, reference)
concatenated_string = public_key + reference
hashed_string = Digest::SHA256.hexdigest(concatenated_string)
return hashed_string
end
# Example Usage
public_key = "your_public_key"
reference = "your_reference"
signature = generate_signature(public_key, reference)
puts signature
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
)
func generateSignature(publicKey, reference string) string {
concatenatedString := publicKey + reference
hash := sha256.New()
hash.Write([]byte(concatenatedString))
hashedString := hash.Sum(nil)
return hex.EncodeToString(hashedString)
}
func main() {
publicKey := "your_public_key"
reference := "your_reference"
signature := generateSignature(publicKey, reference)
fmt.Println(signature)
}
Note
Signature holds the value of the encrypted parameter that should be added to your headers.