Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 2.12 KB

README.md

File metadata and controls

60 lines (37 loc) · 2.12 KB

Pepper

Build Status codecov

An API to fetch profiles of facebook users using their PSID and associating messenger labels to them.

Prerequisite

  • A facebook page (for utilizing messenger)
  • A facebook app (to implement pepper API)
  • A webhook setup (to get users PSIDs)

You may refer this guide to complete prerequisite.

Now get the pepper

  • git clone https://github.com/geekyshacklebolt/pepper.git
  • cd pepper
  • conda create -n pepper python==3.7.3 pip
  • conda activate pepper
  • pip install -r requirements/development.txt

NOTE: You are free to use any suitable tool for python virtual environment.

Configure a bit

  • touch .env

Please have a look at .env.sample, copy its content to .env file in the project root.

Set it up

  • python manage.py migrate
  • python manage.py check
  • python manage.py run

NOTE: You'll need to create a superuser to access API endpoints.

Creating a superuser is just one command

  • python manage.py createsuperuser --username example_name --email example_email

Basic usage

Please explore endpoints.md to understand valid endpoints with their corresponding requests and responses.

  1. Once you create the page on facebook and get its access_token and page_id, then go to the endpoint /api/page in pepper and feed your facebook page credentials.

  2. Then create a messenger label by using the endpoint /api/label.

  3. Now, send the list of PSIDs and a label identifier (which you want to associate with them) using the endpoint /api/psid.

NOTE: An older version of the same API is available in branch csv of this project that accepts PSID list from a csv file.

Contributors

Shiva Saxena