EXAMPLE
We will know more about the API through the example below:
Request
I will call API to authenticate the admin account:
Code Block |
---|
curl \ -X POST -d "{ \"password\": \"dnladminpass\", \"email_or_name\": \"admin\"}" \ "http://88.99.175.131:8000/v1/auth" |
Response
Code Block |
---|
{
"success": true,
"payload": {
"cdr_api_token_expiration": "186544678",
"user": {
"login_ip": "183.182.110.28",
"first_name": "admin",
"fullname": "admin admin",
"create_time": "2017-09-08T22:00:00+00:00",
"passwd": "$2a$12$.vfsbhghghjfgfghdfdghhh7iyoz/euRq6r6",
"report_count": "1 Hour",
"is_online": 1,
"last_name": "admin",
"role_name": "Administrator",
"client_id": null,
"cdr_api_token": "eHC0hakjsdhjhjqeweqweq32njkasdjSSt",
"user_id": 1,
"all_termination": true,
"show_carrier_trunk_drop_only": true,
"default_mod": "0",
"user_type": "admin",
"client_limits": [
{"client_id": 2916},
{"client_id": 2917}
],
"role_id": 0,
"last_login_time": "2018-02-24T21:05:36.094423+00:00",
"reseller_id": 0,
"cdr_expire": "2018-02-25T14:11:53+00:00",
"outbound_report": true,
"email": "[email protected]",
"carrier_name": null,
"default_mod2": "0",
"active": true,
"landing_page": "/routing/rate_table",
"create_user_id": null,
"card_id": 0,
"name": "admin",
"client": null,
"report_group": true,
"last_seen": "2018-02-24T22:11:18.724125+00:00",
"report_fields": "111",
"is_preload": true,
"default_billing_decimal": 0,
"avatar_id": 1366,
"auth_ip": [],
"agent": null
},
"token": "eyaskjksadkasd9.9123kjsadhkj123jhasdjajsjsdhKS.IH5uHASSJsadnbads980asTHo9dhljM",
"cdr_api_token": "eHC0hakjsdhjhjqeweqweq32njkasdjSSt"
}
} |