Coder Social home page Coder Social logo

faq-bot's People

Contributors

mhmmdjafarg avatar qornanali avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

faq-bot's Issues

Create tutorial in English

To provide information on how we build this project, please document it on the following files:

- README.md
- docs/en/...

Add authorization in webhook

In order to prevent malicious requests, please modify the current webhook URL.

From /webhook to /v1/external/messenger/webhook?access_token=<access_token> where access_token is configurable from ENV for now.

Example curl

curl --location --request POST 'https://localhost:3000/external/messenger/v1/webhook?access_token=foo' \
--header 'Content-Type: application/json' \
--data-raw '{
    "object": "page",
    "entry": [
        {
            "id": "107461401142256",
            "time": 1602923843364,
            "messaging": [
                {
                    "sender": {
                        "id": "3394010770691329"
                    },
                    "recipient": {
                        "id": "107461401142256"
                    },
                    "timestamp": 1602923843223,
                    "message": {
                        "mid": "m_sFrBBrkrx2LmF8YZSBf7WeqfkEM-NXTTk34MVB5g2wYZUTOUt4RRD2EWhrrCyy4O86A6bj4NfeKid_R2johmBA",
                        "text": "kartu prakerja",
                        "nlp": {
                            "intents": [
                                {
                                    "id": "653269161996408",
                                    "name": "Tanya_program",
                                    "confidence": 0.9
                                }
                            ],
                            "entities": {
                                "nama_program:nama_program": [
                                    {
                                        "id": "387471645725440",
                                        "name": "nama_program",
                                        "role": "nama_program",
                                        "start": 0,
                                        "end": 14,
                                        "body": "kartu prakerja",
                                        "confidence": 0.9566,
                                        "entities": [],
                                        "value": "Kartu Prakerja",
                                        "type": "value"
                                    }
                                ]
                            },
                            "traits": {
                                "wit$sentiment": [
                                    {
                                        "id": "5ac2b50a-44e4-466e-9d49-bad6bd40092c",
                                        "value": "neutral",
                                        "confidence": 0.536
                                    }
                                ]
                            },
                            "detected_locales": [
                                {
                                    "locale": "id_ID",
                                    "confidence": 0.9685
                                }
                            ]
                        }
                    }
                }
            ]
        }
    ]
}'

If the incoming request has a blank access_token or incorrect, it should response with body:

FAILED

and http status 401 unauthorized.

Add internal endpoint to crud answer

Currently, we assign answers via rails console and it obviously not a good approach.

Please create new endpoints for this contract:

  • For now, the token in basic authorization will be compared to the generated token from the user and password in the config.
  • POST /internal/v1/answers
  • PATCH /internal/v1/answers/:id
  • GET /internal/v1/answers?page=1&limit=5
  • GET /internal/v1/answers/:id
  • DELETE /internal/v1/answers/:id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.