Replies: 1 comment 2 replies
-
|
You can access custom HTTP headers like x-auth-value and x-emp-no in the /v1/chat-messages endpoint by using Flask's request object. In the Dify backend, the chat-messages endpoint is implemented with Flask, and you can retrieve these headers in the endpoint handler with: from flask import request
x_auth_value = request.headers.get('x-auth-value')
x_emp_no = request.headers.get('x-emp-no')You can add this code inside the post method of the ChatApi class (located in To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
Question:
When integrating with the chatflow API and calling the chat-messages endpoint, we include custom headers x-auth-value and x-emp-no in the HTTP request. How can these header values be accessed and retrieved within the chatflow system?
Example Request:
curl -X POST 'http://xx.xx.xx.xx/v1/chat-messages'
--header 'Authorization: Bearer {api_key}'
--header 'Content-Type: application/json'
--header 'x-auth-value: xxxxc4ee05c690exxx74fc0b7xxxxda'
--header 'x-emp-no: 123456'
--data-raw '{
"inputs": {},
"query": "What are the specs of the iPhone 13 Pro Max?",
"response_mode": "streaming",
"conversation_id": "",
"user": "abc-123",
"files": [
]
}'
Beta Was this translation helpful? Give feedback.
All reactions