MyData credit bureau REST API integration for the Axion platform. Implements modern REST-based credit checking using the ObjServiceBureau framework.
This is a reference implementation demonstrating how to create new bureau integrations using REST APIs. It serves as a template for adding additional bureau providers.
Provides credit report data from MyData bureau via REST API, including:
bloom_donormalenquiry tableThe module registers itself with the bureau framework at import time:
ObjServiceBureau.register_bureau("MYDATA", ObjServiceApi)
This enables the router to instantiate MyData through the bureau code "MYDATA".
Configure in def_remoteconnections table:
INSERT INTO def_remoteconnections (
Remote,
RemoteURL,
Username,
RemotePassword,
RemoteInitSql,
basedir,
Package,
Deployment,
Active
) VALUES (
'MYDATA_API_PROD',
'https://api.mydata.example.com/v1/credit-check',
'api_user',
'bearer_token_here',
'SELECT idnumber, gender, dob, firstname, surname, passportflag,
birthdate, application_channel
FROM bloom_hcscore WHERE _guid = $guid$',
'bloom_hcscore',
'homechoice',
'production',
'1'
);
Key Fields:
MYDATA_API% (configured in get_remote_connection_pattern())$guid$ placeholder)To use MyData in routing strategy:
-- 100% MyData
INSERT INTO def_bureau_strategy (BureauCode, RDG_Start, RDG_End)
VALUES ('MYDATA', 0, 100);
-- 50/50 split with another bureau
INSERT INTO def_bureau_strategy (BureauCode, RDG_Start, RDG_End)
VALUES ('MYDATA', 0, 50);
The service sends JSON payload to MyData API:
{
"idNumber": "8001011234567",
"firstName": "John",
"surname": "Doe",
"dateOfBirth": "19800101",
"gender": "M"
}
Expected JSON response structure:
{
"data": {
"credit_score": 650,
"risk_grade": "B",
"accounts_open": 3,
"total_debt": 45000,
"payment_history": "good",
...additional fields...
}
}
All fields in the data object are automatically extracted as variables and stored in bloom tables.
Response is stored in base table (configured in basedir) with column:
Structured data stored in bloom_MYDATA or bloom_MYDATA_sim with:
data object in responseThe bloom_table_data_structure() method automatically creates columns for new fields.
get_bureau_code() - Returns "MYDATA"get_remote_connection_pattern() - Returns "MYDATA_API%" for connection lookupresolve(guid, id_number) - Implements REST API call logicRemoteInitSqldata objectIf API call fails:
resultnote fieldUses response.raise_for_status() to catch HTTP error codes (4xx, 5xx).
When is_simulation() returns True:
bloom_MYDATA_sim tableImplements standard bureau buffering:
bloom_donormalenquiry within buffer time (default 9 days)This reduces API costs for repeated applications from same customer.
# Call MyData for specific GUID
python ObjServiceHCMyData.py {guid}
# Call with parameters
python ObjServiceHCMyData.py {guid} {param1} {param2}
# Current mode
python ObjServiceHCMyData.py current {param1} {param2}
from ObjServiceBureauRouter import ObjServiceBureauRouter
router = ObjServiceBureauRouter()
result = router.run_workflow_direct(guid)
# Router will select MyData based on strategy configuration
from ObjServiceHCMyData import ObjServiceApi
mydata = ObjServiceApi()
mydata.Guid = "abc123..."
result = mydata.resolve(guid)
To create similar REST bureau integration:
get_bureau_code() to your bureau identifierget_remote_connection_pattern()resolve() to match bureau APIObjServiceBureau.register_bureau("YOURBUREAU", ObjServiceApi)
| Aspect | MyData (REST) | Experian (SOAP) |
|---|---|---|
| Protocol | REST/HTTPS | SOAP XML |
| Request Format | JSON | XML envelope |
| Response Format | JSON | Base64-encoded ZIP with JSON |
| Authentication | Bearer token | Username/password in XML |
| Content Type | application/json | text/xml |
| Response Processing | Direct JSON parse | Unzip → Extract → Parse JSON |
Enable debug output:
DO_DEBUG = True
Debug output includes:
ObjServiceBureau.py - Base framework classObjServiceBureauRouter.py - Routing orchestratorObjServiceHCExperian.py - SOAP implementation exampleObjConstants.py - BLOOM_DONORMALENQUIRY constantAxion 8.x