Dispatch lead¶
Description¶
You should use this API to hold your leads or send them. Use POST method with following url: https://mcraftdb.tech/api/v1/dispatch
POST request¶
Headers¶
You may receive an API access key from your partner. Headers:
{
'm-key': 'your-uuid-key'
}
Body¶
{
"ai":"2190291",
"ci":"660",
"gi":"896",
"so":"example",
"url":"https://example.com/?MPC_3=e8f074k8r46vrfd8",
"userip":"70.39.249.51",
"firstname":"test",
"lastname":"trackboxtest",
"email":"tesstt@gmail.com",
"phone":"0704567893",
"prefix":"44",
}
| Param | Type | Description |
|---|---|---|
| ai, ci, gi | string | your ids received from partner |
| so | string | land source name |
| url | string | your land absolute url |
| userip | string | user ip address |
| firstname | string | user first name |
| lastname | string | user last name |
| string | user email address | |
| phone | string | user phone |
| prefix | string | phone prefix, optional |
| MPC_# | string | free parameter, optional |
Response examples¶
A successful response contain the auto-login URL and look like:
{
"status":" true,
"data":"https:\/\/www.brand.com\/signin.php?email=tesstt@gmail.com&password=2iHK9Pvw6aF",
"error": [], "addonData": {"status": "successful", "data": {"accountName": null, "accountPassword": null, "balance": 0, "brokerId": null, "brokerUrl": "xxx", "country": null, "countryCode": null, "currency": "USD", "customerId": "12345", "email": "tesstt@gmail.com", "firstDepositDate": null, "firstName": "xxx", "lastName": "xxx", "token": "12345a251a4f9b2089e85333928622f1", "uniqueid": "123e581bca23331b01d2774dfdbcab32", "loginURLIsForm": null, "id": "12345"}, "failLog": true, "fallbackURL": false}, "fallbackURL": null, "originalData": []
}
A successful response contain hold's status and time until it works:
{
"status": "hold",
"until": "2022-11-07 14:50:23",
"add_data": {
"ai":"2190291",
"ci":"660",
"gi":"896",
"so":"example",
"url":"https://example.com/?MPC_3=e8f074k8r46vrfd8",
"userip":"70.39.249.51",
"firstname":"test",
"lastname":"trackboxtest",
"email":"tesstt@gmail.com",
"phone":"0704567893",
"prefix":"44",
}
}
A failed response from serialization processing:
{"status":false, "detail": {"url": "this field is mandatory"}, "add_data": ...}
{'status': False, "detail": {"email": "Duplicate"}, "add_data": ...}
A failed response from TrackBox:
{"status": false,
"data":"Same user Exist in the last 20 min with the same IP. duplicate LEAD",
"addonData": {"userip":"193.40.210.7","firstname":"test","lastname":"test.","email":"test@gmail.com","phone":"58155713","prefix":"372","password":"dXEnFwt4tugxjYOxWw","MPC_5":"kltg","MPC_7":"revolut","ai":"2958074","ci":"1","gi":"124","so":"quantum","clickid":"7"}}
Python Example¶
import requests
form_data = {"firstname": "test",
"lastname": "test", "email": "test@gmail.com",
"phone": "58155713", "prefix": "372"}
add_data = {"userip": "193.40.210.7",
"url": "https://investmentday.site/?MPC_3=e8f074k8r46vrfd8",
"ai": "2958074", "ci": "1", "gi": "56",
'so': 'quantum', "MPC_7": "revolut"}
data = form_data | add_data
headers = {
'm-key': '420af8fe-99e6-4381-ab13-f27535fed804',
}
url = "https://mcraftdb.tech/api/v1/dispatch"
r = requests.post(url=url, json=data, headers=headers)
print(r.json())