├── db.sqlite3 ├── requirements.txt ├── manage.py ├── LICENSE └── README.md /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/satheesh045/Truecaller-API/HEAD/db.sqlite3 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2019.9.11 2 | chardet==3.0.4 3 | Django==2.2.8 4 | django-filter==2.2.0 5 | djangorestframework==3.10.3 6 | djangorestframework-jwt==1.11.0 7 | idna==2.8 8 | Markdown==3.1.1 9 | PyJWT==1.7.1 10 | pytz==2019.3 11 | requests==2.22.0 12 | sqlparse==0.3.0 13 | urllib3==1.25.7 14 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'truecaller.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Naveen Arora 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Truecaller-APIs 2 | 3 | This is a brief description of what this app does and how these apis work
4 | As specified, this app is just like truecaller and works on same principle
5 | 6 | To start the project, one needs to run the server first using the specified virtual environment.
7 | On Linux,
8 | Enter following commands once you are in this directory
9 |
10 |     source venv/bin/activate 
11 |     cd truecaller
12 |     python manage.py runserver
13 | 
14 | Now the application server has started,

15 | 16 |

Every Functionality implemented in the code could have been implemented using various other methods. I have used methods which I felt would be appropriate

17 | To access anything in the api , one needs to be logged in otherwise it will raise Authentication errors.

18 | 19 |

To register using the API: -


20 | 21 | ENDPOINT - http://localhost:8000/api/auth/register/ 22 |
23 | data = {
24 |     "name": "",
25 |     "phone_number": "",
26 |     "email": "",
27 |     "password": "",
28 |     "password2": ""
29 | }
30 | 


31 |

To login and authenticate into the API :


32 | 33 | ENDPOINT - http://localhost:8000/api/auth/login/
34 |
35 | data = {
36 |     "phone_number/email": "",
37 |     "password": "",
38 | }
39 | 

40 | Note :- I have used JWT Authentication and implicitly logging into django using login function, but for third party devices and apps, we can use token based system to verify and it has also been implemented here only
41 | After logging in you can use below ENDPOINTS 42 |

43 |

Search using the API


44 | ENDPOINT - http://localhost:8000/api/data/
45 |

46 | To search using a phone number -
47 | ENDPOINT - http://localhost:8000/api/data/?p={phone_number}
48 | 49 | Replace {phone_number} with phone number and make a get request 50 |

51 | To search using a name -
52 | ENDPOINT - http://localhost:8000/api/data/?name={name}
53 |
54 | Replace {phone_number} with phone number and make a get request
55 |

56 |

Detail View of Users

57 | ENDPOINT - http://localhost:8000/api/data/{user_id}
58 | 59 | Replace {user_id} with respective id of user to display.
60 | It has been keeping in mind to show the Email if Requested User has logged in user's phone number as a contact
61 |
62 | To mark spam 63 | Make a POST request to the ENDPOINT 64 |

65 |

Detail View of Contacts


66 | ENDPOINT - http://localhost:8000/api/data/p/{user_id}/ 67 |
68 | Replace {user_id} with respective id of user to display.
69 | It has been keeping in mind to show the Email if Requested User has logged in user's phone number as a contact 70 |
71 | To mark spam
72 | Make a POST request to the ENDPOINT
73 | 74 | 75 |

Declaration - This application is intended for educational purposes only. Any use in professional manner or to harm anyone or any organization doesn't relate to me and can be considered as illegal.

76 | 77 | 78 | Promotion - If you are lookingfor best instagram captions for your instagram posts then must check out Instafbcaptions.com 79 | --------------------------------------------------------------------------------