dify api接口变了么 #21115

Closed
opened 2026-02-21 20:10:50 -05:00 by yindo · 2 comments
Owner

Originally created by @lij82304885 on GitHub (Dec 17, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Version 1.11.1 为什么调用api接口访问不通
curl --location --request GET "http://192.168.199.195:8011/v1/messages/2ec23927-aca3-48d7-b397-bf23d842fea7/suggested?user=abc_123"
--header "Authorization: Bearer app-BOUqLo31EyvoGhGs1W7EbZrA"
--header "Content-Type: application/json"

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @lij82304885 on GitHub (Dec 17, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Version 1.11.1 为什么调用api接口访问不通 curl --location --request GET "http://192.168.199.195:8011/v1/messages/2ec23927-aca3-48d7-b397-bf23d842fea7/suggested?user=abc_123" \ --header "Authorization: Bearer app-BOUqLo31EyvoGhGs1W7EbZrA" \ --header "Content-Type: application/json" ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🙋‍♂️ question label 2026-02-21 20:10:50 -05:00
yindo closed this issue 2026-02-21 20:10:50 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 17, 2025):

Dify 的 /v1/messages/{id}/suggested API 接口在 1.11.1 版本依然存在,没有被移除或做破坏性更改。你遇到的访问不通问题,通常不是因为接口变了,而是由于配置或权限问题,比如:

  • 需要 Bearer token 且 user 参数必须在 query string 里(如 ?user=xxx);
  • 只有在 app 处于 CHAT、AGENT_CHAT 或 ADVANCED_CHAT 模式时接口才可用,否则会报错;
  • 如果“回答后推荐问题”功能没有在 app 或 workflow 配置中启用,接口会返回 400(Suggested Questions Is Disabled);
  • message_id 必须存在且属于当前 user,否则会报 404;
  • token 失效、权限不足、网络或防火墙阻断也会导致访问失败。

建议你检查 token 是否有效、app 配置和模式是否正确、message 是否存在且属于当前 user,并查看服务端日志获取具体错误信息。接口的详细实现和错误处理可以参考这里这里

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 17, 2025): <!-- Answer --> Dify 的 /v1/messages/{id}/suggested API 接口在 1.11.1 版本依然存在,没有被移除或做破坏性更改。你遇到的访问不通问题,通常不是因为接口变了,而是由于配置或权限问题,比如: - 需要 Bearer token 且 user 参数必须在 query string 里(如 ?user=xxx); - 只有在 app 处于 CHAT、AGENT_CHAT 或 ADVANCED_CHAT 模式时接口才可用,否则会报错; - 如果“回答后推荐问题”功能没有在 app 或 workflow 配置中启用,接口会返回 400(Suggested Questions Is Disabled); - message_id 必须存在且属于当前 user,否则会报 404; - token 失效、权限不足、网络或防火墙阻断也会导致访问失败。 建议你检查 token 是否有效、app 配置和模式是否正确、message 是否存在且属于当前 user,并查看服务端日志获取具体错误信息。接口的详细实现和错误处理可以参考[这里](https://github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/api/controllers/service_api/app/message.py#L190-L228)和[这里](https://github.com/langgenius/dify/issues/17194)。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/082d3526-ccf4-4922-90bd-0efbce710c25?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/082d3526-ccf4-4922-90bd-0efbce710c25?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/082d3526-ccf4-4922-90bd-0efbce710c25?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/082d3526-ccf4-4922-90bd-0efbce710c25?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/082d3526-ccf4-4922-90bd-0efbce710c25?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/082d3526-ccf4-4922-90bd-0efbce710c25?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/082d3526-ccf4-4922-90bd-0efbce710c25?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Dify%20%E7%9A%84%20/v1/messages/%7Bid%7D/suggested%20API%20%E6%8E%A5%E5%8F%A3%E5%9C%A8%201.11.1%20%E7%89%88%E6%9C%AC%E4%BE%9D%E7%84%B6%E5%AD%98%E5%9C%A8%EF%BC%8C%E6%B2%A1%E6%9C%89%E8%A2%AB%E7%A7%BB%E9%99%A4%E6%88%96%E5%81%9A%E7%A0%B4%E5%9D%8F%E6%80%A7%E6%9B%B4%E6%94%B9%E3%80%82%E4%BD%A0%E9%81%87%E5%88%B0%E7%9A%84%E8%AE%BF%E9%97%AE%E4%B8%8D%E9%80%9A%E9%97%AE%E9%A2%98%EF%BC%8C%E9%80%9A%E5%B8%B8%E4%B8%8D%E6%98%AF%E5%9B%A0%E4%B8%BA%E6%8E%A5%E5%8F%A3%E5%8F%98%E4%BA%86%EF%BC%8C%E8%80%8C%E6%98%AF%E7%94%B1%E4%BA%8E%E9%85%8D%E7%BD%AE%E6%88%96%E6%9D%83%E9%99%90%E9%97%AE%E9%A2%98%EF%BC%8C%E6%AF%94%E5%A6%82%EF%BC%9A%0A%0A-%20%E9%9C%80%E8%A6%81%20Bearer%20token%20%E4%B8%94%20user%20%E5%8F%82%E6%95%B0%E5%BF%85%E9%A1%BB%E5%9C%A8%20query%20string%20%E9%87%8C%EF%BC%88%E5%A6%82%20%3Fuser%3Dxxx%EF%BC%89%EF%BC%9B%0A-%20%E5%8F%AA%E6%9C%89%E5%9C%A8%20app%20%E5%A4%84%E4%BA%8E%20CHAT%E3%80%81AGENT_CHAT%20%E6%88%96%20ADVANCED_CHAT%20%E6%A8%A1%E5%BC%8F%E6%97%B6%E6%8E%A5%E5%8F%A3%E6%89%8D%E5%8F%AF%E7%94%A8%EF%BC%8C%E5%90%A6%E5%88%99%E4%BC%9A%E6%8A%A5%E9%94%99%EF%BC%9B%0A-%20%E5%A6%82%E6%9E%9C%E2%80%9C%E5%9B%9E%E7%AD%94%E5%90%8E%E6%8E%A8%E8%8D%90%E9%97%AE%E9%A2%98%E2%80%9D%E5%8A%9F%E8%83%BD%E6%B2%A1%E6%9C%89%E5%9C%A8%20app%20%E6%88%96%20workflow%20%E9%85%8D%E7%BD%AE%E4%B8%AD%E5%90%AF%E7%94%A8%EF%BC%8C%E6%8E%A5%E5%8F%A3%E4%BC%9A%E8%BF%94%E5%9B%9E%20400%EF%BC%88Suggested%20Questions%20Is%20Disabled%EF%BC%89%EF%BC%9B%0A-%20message_id%20%E5%BF%85%E9%A1%BB%E5%AD%98%E5%9C%A8%E4%B8%94%E5%B1%9E%E4%BA%8E%E5%BD%93%E5%89%8D%20user%EF%BC%8C%E5%90%A6%E5%88%99%E4%BC%9A%E6%8A%A5%20404%EF%BC%9B%0A-%20token%20%E5%A4%B1%E6%95%88%E3%80%81%E6%9D%83%E9%99%90%E4%B8%8D%E8%B6%B3%E3%80%81%E7%BD%91%E7%BB%9C%E6%88%96%E9%98%B2%E7%81%AB%E5%A2%99%E9%98%BB%E6%96%AD%E4%B9%9F%E4%BC%9A%E5%AF%BC%E8%87%B4%E8%AE%BF%E9%97%AE%E5%A4%B1%E8%B4%A5%E3%80%82%0A%0A%E5%BB%BA%E8%AE%AE%E4%BD%A0%E6%A3%80%E6%9F%A5%20token%20%E6%98%AF%E5%90%A6%E6%9C%89%E6%95%88%E3%80%81app%20%E9%85%8D%E7%BD%AE%E5%92%8C%E6%A8%A1%E5%BC%8F%E6%98%AF%E5%90%A6%E6%AD%A3%E7%A1%AE%E3%80%81message%20%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E4%B8%94%E5%B1%9E%E4%BA%8E%E5%BD%93%E5%89%8D%20user%EF%BC%8C%E5%B9%B6%E6%9F%A5%E7%9C%8B%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%97%A5%E5%BF%97%E8%8E%B7%E5%8F%96%E5%85%B7%E4%BD%93%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF%E3%80%82%E6%8E%A5%E5%8F%A3%E7%9A%84%E8%AF%A6%E7%BB%86%E5%AE%9E%E7%8E%B0%E5%92%8C%E9%94%99%E8%AF%AF%E5%A4%84%E7%90%86%E5%8F%AF%E4%BB%A5%E5%8F%82%E8%80%83%5B%E8%BF%99%E9%87%8C%5D%28https%3A//github.com/langgenius/dify/blob/df2f1eb028f9e7c7083e96b2c90ee28cb7f53a6d/api/controllers/service_api/app/message.py%23L190-L228%29%E5%92%8C%5B%E8%BF%99%E9%87%8C%5D%28https%3A//github.com/langgenius/dify/issues/17194%29%E3%80%82)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29802)
Author
Owner

@lij82304885 commented on GitHub (Dec 17, 2025):

:8080/#/:1 Access to XMLHttpRequest at 'http://192.168.199.195:8011/v1/messages/86d14c0c-f250-4a04-b76c-d1b46973c08c/suggested?user=abc-123' from origin 'http://192.168.199.49:8080/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. 局域网调用 为什么访问chat-messages接口不跨域,访问messages就跨域

@lij82304885 commented on GitHub (Dec 17, 2025): :8080/#/:1 Access to XMLHttpRequest at 'http://192.168.199.195:8011/v1/messages/86d14c0c-f250-4a04-b76c-d1b46973c08c/suggested?user=abc-123' from origin 'http://192.168.199.49:8080/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. 局域网调用 为什么访问chat-messages接口不跨域,访问messages就跨域
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21115