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/v4/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 --location 'https://portal.your.md//v4/chat' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Authorization: Bearer eyJraWQiOiI0Y2RmY2Q0OS1kM2QyLTRlZGMtYThlZi02MDY5ZjRmZWYwNmMiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bWRNb3JzZV9DU2dJRE1QMERZSVJTVmx6T0JXRng0d2lzYjZWT2pFN0tOYmo5dFNOS3prWSIsImF1ZCI6InJhbXAiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZGV2aWNlX2lkIjoicGFydG5lcl9yYW1wX2I2N2EyMWIwNGY4YTI2Y2RkZTgzYmYyZDQ4MTZlYTA5NjdlYjNmMGYxMjAxZmIzY2I3NjNjODdiODViMGM5ZWQiLCJuYW1lIjoiVGltIEhleWVzIiwiZGVsZXRlX2F0IjoxNjc3MTY5NzUxLCJlbWFpbCI6InRlc3R1c2VyYmJmNzJlZDUtN2NmZC00YjZkLTkxMmEtYjAwNzViZGZkMmRhQGdtYWlsLmNvbSIsImlzcyI6InltZC1pbnRlcm5hbC1zZXJ2aWNlLXByb2QiLCJqdGkiOiI0YjUxOTFhMC0wZWY2LTRkMDEtODJiNC1jMzliZWM2YTQ2MDAiLCJpYXQiOjE2NzY5OTY5NTEsImV4cCI6MTY3Njk5ODc1MX0.YhbX1qrSlLUQnO70_hfI6GRO9Te0bfX_OCvBa1fwRMnvm6BLuW82KS9c4aFimvBpj4iMbx0_IJly8_kxOMDm9tFurZyc_Di5tO4ZBpb8nfUnTQJdwDOZ1ZbeBBCdeu7tcdaM5nRkc7eqE0cqEfgX1eKPL-J-PJmoSYknDq945NJ-oWim5ZAxR6dbT47Jp9i2w9UXB_zQ5hbM6OzoWzGfAqd7G_fOpSmwTOMXB64kRksd6LW9y_jYVBqlh4xM0bCWL2FfSW1VFMI88ncMPZaTggUZ67JkUTzIfSe6PSpvZgkhc1eW_4wwBU5wvFUtkvtSOm15YRCzOaqOdfe8BWhu9g' \
--header 'x-api-key: SSM6gjt7vQaBYB7Q38UbF72xHfNaU7No7fYwJdIS' \
--data '{
    "answer": {
        "type": "entry",
        "name": "Frank",
        "gender": "male",
        "year_of_birth": 1978,
        "initial_symptom": "shaking",
        "debug": false,
        "other": false
    }      
}'

Body

Request body schema: application/json

NameDescription
answer (required)The answer represents the user selection. More information can be found in Chat request structure

Example response:

{
    "conversation": {
        "id": "2e51ecc7-8c52-4a2d-bfff-45176614469d",
        "scenario": "consultation_routine",
        "phase": "symptom_check",
        "available_commands": [
            "STOP_CONVERSATION"
        ],
        "progress": {
            "stage": "Your symptoms",
            "percentage": 0
        }
    },
    "question": {
        "type": "generic",
        "messages": [
            {
                "type": "generic",
                "value_type": "TEXT",
                "value": "Sorry you're unwell, Frank.",
                "meta": {}
            },
            {
                "type": "generic",
                "value_type": "TEXT",
                "value": "Just to check, are these your symptoms?",
                "meta": {}
            },
            {
                "type": "generic",
                "value_type": "TEXT",
                "value": "Please choose all the ones you have. (If something's missing, you can add it later.)",
                "meta": {}
            }
        ],
        "mandatory": true,
        "multiple": true,
        "choices": [
            {
                "type": "generic",
                "id": "clarify_CM001658",
                "label": "Shaking"
            }
        ]
    },
    "user": {
        "name": "Frank",
        "gender": "m",
        "age": 45,
        "year_of_birth": 1978,
        "other": false,
        "initial_symptom": "shaking"
    }
}