Here, is the REST API designed for mobile applications to detect whether the caller is a spammer.
For assumption, we have considered the global database where every number is present with the spam likelihood rating.
When a user downloads the mobile app the contacts are switched to the user database after registration or login. When a user adds the caller to spammers list the global database spam likelihood rating will be updated.
Adding an email for the user is optional. Users can add email after registration.
(user authentication is done through Token)
virtualenv env
env\Scripts\activate
pip install django djangorestframework
POST /signup
Parameter | Type | Description |
---|---|---|
username |
string |
Required. username |
password |
string |
Required. password |
phone_number |
string |
Required. phone number |
name |
string |
Required. your name |
Response:{Token}
POST /signin
Parameter | Type | Description |
---|---|---|
username |
string |
Required. username |
password |
string |
Required. password |
Response:{Token}
GET /search?name={name}
Parameter | Type | Description |
---|---|---|
name |
string |
Required. name |
Response:{name, phone_number, spam_likely_hood}
GET /search?number={number}
Parameter | Type | Description |
---|---|---|
number |
string |
Required. number |
Response:{name, phone_number, spam_likely_hood}
The person’s email is only displayed if the person is a registered user and the who is searching is in the person’s contact list.
Response:{name, phone_number, spam_likely_hood, email}
GET /spam?number={number}
Parameter | Type | Description |
---|---|---|
number |
string |
Required. number |
Response:{phone_number, report_time}
POST /addemail
Parameter | Type | Description |
---|---|---|
email |
string |
Required. email |
Response:{message}