Q:

BITGO - Can't Get Hash on Request

What is the key to call from BitGo API to get from a webhook immediately an address receive BTC.
From my ngrok, I saw this
{
    "hash": "26ba9cc3218962417f529803d82dd63850b895fbee74517dff",
    "type": "transaction",
    "coin": "bitcoin",
    "walletId": "2Mzb4KMAp"
}

So when I did the following in the 'hook callback url', I'm getting error. 500 Error.
1. txId  =  request.POST.get('hash')
2. txId = request.GET['hash']
3. txId = request.POST['hash']

How do I get the hash since all the above method failed. I'm using Python/Django.

A:

The BitGo API will uses POST to send JSON data to your endpoints: https://bitgo.github.io/bitgo-docs/#webhook-notifications
You'll likely need to convert the body of their POST request from JSON into a Python dict you can access more easily. You can do this with json.loads:
bitgo_data = json.loads(request.body)
hash = bitgo_data['hash']

