document/create_by_text interface #4794

Closed
opened 2026-02-21 18:08:03 -05:00 by yindo · 4 comments
Owner

Originally created by @yuhp-zts on GitHub (Jul 26, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.11

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I use an HTTP request in a workflow to call Dify's document/create_by_text interface,
I want to pass the "text" parameter from data-raw as a variable, but it throws an error.
The HTTP request is as follows, where "text": "{my_text}" is passed as a variable.

curl --location --request POST 'http://localhost/v1/datasets/{dataset_id}/document/create_by_text'
--header 'Authorization: Bearer {api_key}'
--header 'Content-Type: application/json'
--data-raw '{"name": "text","text": "{my_text}","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}}'

the error:
{
"status_code": 400,
"body": "{"code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400}\n",
"headers": {
"server": "nginx/1.25.4",
"date": "Fri, 26 Jul 2024 06:44:58 GMT",
"content-type": "application/json",
"content-length": "130",
"access-control-allow-origin": "*",
"set-cookie": "remember_token=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/",
"x-version": "0.6.11",
"x-env": "PRODUCTION",
"cache-status": "4f14e8efe63d;detail=mismatch",
"via": "1.1 4f14e8efe63d (squid/6.1)",
"connection": "keep-alive"
},
"files": []
}

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @yuhp-zts on GitHub (Jul 26, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.11 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When I use an HTTP request in a workflow to call Dify's document/create_by_text interface, I want to pass the "text" parameter from data-raw as a variable, but it throws an error. The HTTP request is as follows, where "text": "{my_text}" is passed as a variable. curl --location --request POST 'http://localhost/v1/datasets/{dataset_id}/document/create_by_text' \ --header 'Authorization: Bearer {api_key}' \ --header 'Content-Type: application/json' \ --data-raw '{"name": "text","text": "{my_text}","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}}' the error: { "status_code": 400, "body": "{\"code\": \"bad_request\", \"message\": \"The browser (or proxy) sent a request that this server could not understand.\", \"status\": 400}\n", "headers": { "server": "nginx/1.25.4", "date": "Fri, 26 Jul 2024 06:44:58 GMT", "content-type": "application/json", "content-length": "130", "access-control-allow-origin": "*", "set-cookie": "remember_token=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/", "x-version": "0.6.11", "x-env": "PRODUCTION", "cache-status": "4f14e8efe63d;detail=mismatch", "via": "1.1 4f14e8efe63d (squid/6.1)", "connection": "keep-alive" }, "files": [] } ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:08:03 -05:00
yindo closed this issue 2026-02-21 18:08:03 -05:00
Author
Owner

@yuhp-zts commented on GitHub (Jul 26, 2024):

image

@yuhp-zts commented on GitHub (Jul 26, 2024): ![image](https://github.com/user-attachments/assets/77ef6725-8fe7-43a7-ad39-f9ad2807f529)
Author
Owner

@crazywoola commented on GitHub (Jul 26, 2024):

{"code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400}
This error indicates you have input something wrong with the payload.

So you need to do things listed below.

image image
@crazywoola commented on GitHub (Jul 26, 2024): `{"code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400}` This error indicates you have input something wrong with the payload. So you need to do things listed below. <img width="685" alt="image" src="https://github.com/user-attachments/assets/effe9b43-d6ba-4a61-a96d-18f958faef39"> <img width="686" alt="image" src="https://github.com/user-attachments/assets/907856ad-5231-41d7-a043-184fa3db9074">
Author
Owner

@yuhp-zts commented on GitHub (Jul 26, 2024):

{"code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400} This error indicates you have input something wrong with the payload.

So you need to do things listed below.

image image

But isn't \n supposed to be a delimiter used for separation? Why would you need to replace this symbol?

@yuhp-zts commented on GitHub (Jul 26, 2024): > `{"code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400}` This error indicates you have input something wrong with the payload. > > So you need to do things listed below. > > <img alt="image" width="685" src="https://private-user-images.githubusercontent.com/100913391/352423496-effe9b43-d6ba-4a61-a96d-18f958faef39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5Nzc0MTYsIm5iZiI6MTcyMTk3NzExNiwicGF0aCI6Ii8xMDA5MTMzOTEvMzUyNDIzNDk2LWVmZmU5YjQzLWQ2YmEtNGE2MS1hOTZkLTE4Zjk1OGZhZWYzOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyNlQwNjU4MzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YThmNTU0MjRlMjdjZDI5NDc0OTE4NmYyZTRhOGY0MzQ4Njk1ZjgzMjhiYmFiMGQzNGUxYTYxNDcxODA3NGZiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.0TxiLwEH17WdcCYG9oJUlJUvVVzUJAz3loTymxgmwK4"> <img alt="image" width="686" src="https://private-user-images.githubusercontent.com/100913391/352423730-907856ad-5231-41d7-a043-184fa3db9074.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5Nzc0MTYsIm5iZiI6MTcyMTk3NzExNiwicGF0aCI6Ii8xMDA5MTMzOTEvMzUyNDIzNzMwLTkwNzg1NmFkLTUyMzEtNDFkNy1hMDQzLTE4NGZhM2RiOTA3NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyNlQwNjU4MzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00ZjI4NDE2ZTE4NDdhYTlmYzFiZjg5NWYyNTczZjQxYzNlMTNmNGUzYjk0YThiZjM2MTYzOGE4OGY2MDg3OGU2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.PN7raM82VVISo3BO9d-M71bXgKJKiPUESHRDVQUhuwM"> But isn't \n supposed to be a delimiter used for separation? Why would you need to replace this symbol?
Author
Owner

@yuhp-zts commented on GitHub (Jul 26, 2024):

{"code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400} This error indicates you have input something wrong with the payload.
So you need to do things listed below.
image image

But isn't \n supposed to be a delimiter used for separation? Why would you need to replace this symbol?

I am using the content from this website:
http://www.csrc.gov.cn/csrc/c101928/c7470656/content.shtml

@yuhp-zts commented on GitHub (Jul 26, 2024): > > `{"code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400}` This error indicates you have input something wrong with the payload. > > So you need to do things listed below. > > <img alt="image" width="685" src="https://private-user-images.githubusercontent.com/100913391/352423496-effe9b43-d6ba-4a61-a96d-18f958faef39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5Nzc0MTYsIm5iZiI6MTcyMTk3NzExNiwicGF0aCI6Ii8xMDA5MTMzOTEvMzUyNDIzNDk2LWVmZmU5YjQzLWQ2YmEtNGE2MS1hOTZkLTE4Zjk1OGZhZWYzOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyNlQwNjU4MzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YThmNTU0MjRlMjdjZDI5NDc0OTE4NmYyZTRhOGY0MzQ4Njk1ZjgzMjhiYmFiMGQzNGUxYTYxNDcxODA3NGZiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.0TxiLwEH17WdcCYG9oJUlJUvVVzUJAz3loTymxgmwK4"> <img alt="image" width="686" src="https://private-user-images.githubusercontent.com/100913391/352423730-907856ad-5231-41d7-a043-184fa3db9074.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5Nzc0MTYsIm5iZiI6MTcyMTk3NzExNiwicGF0aCI6Ii8xMDA5MTMzOTEvMzUyNDIzNzMwLTkwNzg1NmFkLTUyMzEtNDFkNy1hMDQzLTE4NGZhM2RiOTA3NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyNlQwNjU4MzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00ZjI4NDE2ZTE4NDdhYTlmYzFiZjg5NWYyNTczZjQxYzNlMTNmNGUzYjk0YThiZjM2MTYzOGE4OGY2MDg3OGU2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.PN7raM82VVISo3BO9d-M71bXgKJKiPUESHRDVQUhuwM"> > > But isn't \n supposed to be a delimiter used for separation? Why would you need to replace this symbol? I am using the content from this website: http://www.csrc.gov.cn/csrc/c101928/c7470656/content.shtml
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4794