Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Real-Time Web-Service
  • Integration

Testing and Security

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

Related Articles

  • HTTP Request
  • Real-time Web Service

This will serve as guide as how you will be able to test the webhook integration works with your system. You should be able to just invoke the endpoint mentioned below, supplied with the API-key in the header.

Target Endpoint:

POST https://api.begini.co/v1/webhooks-management/test

Headers:

Api-key: <API Key from Integration>

 

Response Status

Status Code Response Body Description
200
{
    "webhook_receiver_status_code": 200,
    "detail": "Any detail"
}
This will identify that the webhook was successfully transmitted to the webhook receiver.
400
{     
 "detail": "No Api-key supplied"     
}
Api-key is not SUPPLIED in the request header
403
{     
    "detail": "Invalid Api-key"     
} 
Api-key is NOT valid or is not registered in the system. Please create an API-key in the begini dashboard in order to use the Test API for webhooks.
424
{     
    "detail": "Webhooks not set for 622056dce007dc805c741751, please set in Begini Dashboard"     
}
Webhook is not set in the Dashboard
422
{     
    "detail":  {     
        "webhook_receiver_status_code": 403,  
        "webhook_receiver_body_content": "{\"detail\":\"Validation Failure\"}"     
    }     
}
This means that the webhook was able to communicate to the webhook receiver, but the webhook receiver returned an error.
503
{     
    "detail": "Cannot connect to host example.com "     
}
This means that Begini Webhook System cannot connect to the Client's Webhook Receiver

 

 

 

Security Features

  • Begini advises to whitelist the IPs of the Begini Platform for additional security.
  • Begini uses HMAC signature (Hexdigest) to ensure that the webhook transmitted is not altered in the middle and the authenticity of the payload really comes from the Begini Platform. In order to verify the HMAC signature, the API Key will be used to generate the HMAC Hex Digest that will be compared to the signature. Please sample code how to validate the HMAC

Python using FastAPI:

import hashlib
import hmac
from fastapi import APIRouter,  Request, HTTPException, status
test_router = APIRouter()
@test_router.post('/webhook-receiver')
async def test(request: Request):
    payload = await request.body()
    signature_from_request = request.headers.get("X-Signature")
    expected_signature = hmac.new('<API-Key>'.encode('utf-8'), payload, digestmod=hashlib.sha512).hexdigest()
    if not hmac.compare_digest(expected_signature, signature_from_request):
        raise HTTPException(status_code=403, detail='Validation Failure')
    return status.HTTP_200_OK

 

 

 

protection evaluation

Was this article helpful?

Yes
No
Give feedback about this article

Updated at January 8th, 2025

Begini Logo_white

SaaS technology that provide character-based credit scores for Banks, Micro Finance, Digital Lenders, Neo Banks, BNPL and Asset Financing.

About

  • About Us
  • Contact Us
  • Privacy Policy

Solutions

  • Device Data
  • Psychometrics

Resources

  • Support
  • Blog
Linkedin Twitter Medium Youtube

© All rights reserved

GPDR compliant white
Expand