PlatformAPI

Pre-requites installation

  1. docker
  2. docker-compose

Start Dev Server

# start mongo in docker firstly
make run

Test Endpoint

curl localhost:8080/health

# if you get response {"status":"ok"}, represent it work.

Function

Receive message from line

  1. register web hook url, web hook endpoint will be http://{endpoint}/webhook/line
  2. copy channel secret and access token to project/config.json
  3. restart server again
make run
  1. Send message from your line

Send back message to customer

  1. you can get customerId from
    • collection: message
    • field: user_id
# curl http://localhost:8080/messaging/line -X POST -d '{"To": "Ue289fb7b4854f46458a934d286cb178d", "Text": "hello"}'

curl http://localhost:8080/messaging/line -X POST -d '{"To": "$customerId", "Text": "hello"}'

List messages of customer

curl http://localhost:8080/message/customer/{$customerId}

# curl http://localhost:8080/message/customer/Ue289fb7b4854f46458a934d286cb178d