Get Payload Hash

This method retrieves the calculated hash of a payload using various supported hashing algorithms. The client must specify the desired hash type through the type query string parameter.

Supported Hash Types:

  • SHA256

  • SHA384

  • SHA512

  • HMACMD5

  • HMACSHA1

  • HMACSHA256

  • HMACSHA384

  • HMACSHA512

POST /
curl -X POST 'https://api.firstoken.co/proxy/hash/?type=SHA256' \
--header 'ft-access-key : YOUR_ACCESS_KEY' \
--data-raw '{
    "chd": {
        "holder": "{{4242428XsEs24242:detokenize | extract:name}}",
        "number": "{{4242428XsEs24242:detokenize | extract:card}}",
        "csc": "{{4242428XsEs24242:detokenize | extract:card | encrypt}}",
        "holderToken": "Yuri",
        "bin": "401200",
        "numberToken": "{{4242428XsEs24242:detokenize | extract:token }}",
        "numberLength": 16,
        "cscToken": "737",
        "cscLength": 3,
        "expiration": {
            "month": "{{4242428XsEs24242:detokenize | extract:expiration | date:MM}}",
            "year": "{{4242428XsEs24242:detokenize | extract:expiration | date:YY}}"
        },
        "document": "",
        "token": null
}'

Important Note for HMAC Hash Types:

When using any HMAC hash type, the client must provide an additional HTTP header titled ft-hmackey. This header should contain the HMAC key in a base64 encoded format. Failure to supply this header, or providing an improperly formatted value, will result in a hashing error.

Please ensure that you use the correct hash type and appropriate encoding for the HMAC key to successfully generate the payload hash.

Example of Response
{
    "status": 200,
    "data": {
        "hashValue": "PZ6/iPaSDMbL7+uWUQwy6IFrI78tqfeXRngthxgboOA=",
        "hashType": "SHA256"
    }
}

Last updated

Was this helpful?