An API to fetch profiles of facebook users using their PSID and associating messenger labels to them.
- 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.
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.
touch .env
Please have a look at .env.sample, copy its content to .env
file in the project root.
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
Please explore endpoints.md to understand valid endpoints with their corresponding requests and responses.
-
Once you create the page on facebook and get its
access_token
andpage_id
, then go to the endpoint/api/page
in pepper and feed your facebook page credentials. -
Then create a messenger label by using the endpoint
/api/label
. -
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.