The values that are to be passed in the API is supposed to be in the alphabetical order. Like in my case above, if we arrange the keys in alphabetical order the
keys will be:
format, pbapisign (i.e. the public key) and
pnr.
So the string to be hashed will be
'json'.'<My Public API Key>'.'1234567890'
.
Now to generate the hash, basically you can use any PHP function. I use the
hash_hmac() function to generate the hash.
Now its working for me. Hope this helps anyone who's working with the Rail PNR API.
Thanks.