Using your Access Token to authenticate API requests

Once your time-limited Access Token has been retrieved, this must be passed to the chat endpoint in the Authorization header for all future requests.

📘Info

The Access Token is not preceded by anything in the Authorization header when making a request to the chat endpoint.

POST https://portal.your.md/v3/chat

Headers

NameDescription
Content-Typeapplication/json
AuthorizationJWT Access Token taken from the response when making a request to the login endpoint
x-api-keyYour Healthily API key

Example request:

curl -X POST https://portal.your.md/v3/chat \
     -H "Authorization: eyJraWQiOi10Y2RmY2Q0OS1kM2QyJFRlZGMtYThlZi02MDY5ZjRmZWYwNmMiLCJhbFhiOiJSUzI1NiJ9.eyJzdWIiOiJ5bWRNb3JzZV9pcGp6ZlRtMmwwRlhvd01zaXBIaWlObGZmZVlLb1ZPeWZmcmhyYmJpcGlzN2pXSlkiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImRldmljZV9pZCI6InBhcnRuZXJfcmFtcF83NDdlNWE0OTlkNTYzNjI0ZGFjMjBmYTQ4NGU1ZjQwMzczYmNiODg5YmI2NzIzYzRmNTExMjgyOTY0NmFlZWI2IiwiaXNzIjoieW1kLWludGVybmFsLXNlcnZpY2UtcHJvZCIsImp0aSI6ImZiMmNjZjJiLTNlZDYtNGRkMi04NWY4LWM1NThiODUxN2U3ZCIsImlhdCI6MTY0Nzg2MjAxOSwiZXhwIjoxNjQ3ODYzODE5fQ.rLQknhj00FvBI6fAKOcutyE3kpcO9PSJI60-PGynuU-rpAGVFXGl3oJQjlmEiJdj6cm3_bGqJbZUFXiJ56eDUwJ13coLTcQwoBPwAf2tActpJnjRMJivCB_b_sialoYRH0OZkiOysmEV01L4aHq8R535UpVlY4U-wxhhD7JYhLpo-e9BRbl2EgQhuFXLzl3s4ZPCSH7yMLn5KqfJIgcCoqL2f6nduZbFVXeKCmMjh5F2hs6QdKZPbBBVZBG9an6ACncvnwgqvUC00CmzEh76znjI8Xxeq1wSmwNYpBXQS3mPjUCpJAXIk5kjCSucu0BHngHYYBU3tL4Ifcs-vhgLqQ" \
     -H "x-api-key: GrNh3vPVdckgA9mCHxdmaSM2ucaywMZ9HbRJ1qTa"\
     -H "Content-Type: application/json" -d '
        {
                "message": "new_install"
            }'

Body

Request body schema: application/json

NameDescription
message (required)The message represents the user selection. More information can be found in ENTER GUIDE LINK HERE

Example response:

{
    "popup": false,
    "messages": [
        {
            "type": "TEXT",
            "value": "Welcome!",
            "meta": {
                "chat_context": [
                    "false"
                ]
            }
        },
        {
            "type": "TEXT",
            "value": "What would you like to do?",
            "meta": {
                "chat_context": [
                    "false"
                ]
            }
        }
    ],
    "question": {
        "mandatory": true,
        "multiple": false,
        "choices": [
            {
                "id": "0",
                "label": "Check symptoms"
            },
            {
                "id": "1",
                "label": "Health tests"
            },
            {
                "id": "2",
                "label": "Ask a question"
            }
        ]
    },
    "conversation_model": {
        "conversation_context": {
            "conversation": false,
            "type": "ASSESSMENT"
        },
        "symptoms_summary": {},
        "report": {}
    },
    "conversation_id": "b7f410bb-a49c-4746-a563-779aa80cffaf"
}