User API¶
-
UserSerializer
¶ Read:
API to real Call rate, SMS rate and to read current balance.
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://HOSTNAME_IP/rest-api/users/
Response:
{ "count": 2, "next": null, "previous": null, "results": [ { "url": "http://127.0.0.1:8000/rest-api/users/3/", "username": "mister", "last_name": "", "first_name": "", "email": "", "balance": 0.0, "call_rate": 0.0, "sms_rate": 0.0 }, { "url": "http://127.0.0.1:8000/rest-api/users/1/", "username": "areski", "last_name": "Areski", "first_name": "Belaid", "email": "areski@gmail.com", "balance": 0.008, "call_rate": 0.008, "sms_rate": 0.02 } ] }
CURL Usage to read a single user:
curl -u username:password -H 'Accept: application/json' http://HOSTNAME_IP/rest-api/users/1/
Response:
{ "url": "http://127.0.0.1:8000/rest-api/users/1/", "username": "areski", "last_name": "Areski", "first_name": "Belaid", "email": "areski@gmail.com", "balance": 0.008, "call_rate": 0.008, "sms_rate": 0.02 }