This script, ObjHookHCScoreCR.py, is a webhook handler designed to process customer scoring data from Credico. It receives a payload with customer information, normalizes and inserts this data into the bloom_hcscore table, triggers a scoring workflow, and then sends an SMS notification.
The script executes the following steps:
Param1) that uniquely identifies the customer scoring request.bloom_hcscorecr_payload table. The data from this table is then normalized and inserted into the bloom_hcscore table. This process includes:
Firstname and Surname.HCSCORE workflow, passing the GUID to it. This workflow is responsible for the actual customer scoring process.bloom_hcscorecr_payload table and sends an SMS notification to the customer via an external API.The script expects the following input parameters:
payload: The raw payload from the webhook.webhook_code: The code for the webhook (e.g., "HCSCORECR").Param1: The GUID of the customer scoring request.Param2 - Param8: Additional parameters (not currently used).The script interacts with the following database tables:
stage_service: (Commented out) An initial INSERT statement to this table is commented out, but a final UPDATE statement is present to mark the service as "DONE".bloom_hcscorecr_payload: The script reads customer data from this table using the provided GUID.bloom_hcscore: The script inserts the normalized customer data into this table.The script makes a POST request to the following external API to send an SMS notification:
https://hcawsgateway.technocore.co.za/webhook.py{"context":"homechoicedirect"}Content-Type: application/jsonUser-Agent: Credico{
"content": "{idno} | Credico",
"smsLocation": "100003",
"cellNumber": "{cellno}",
"context": "homechoicedirect"
}
The script depends on the following modules:
ossysrequestsObjDataObjWorkflow