curl --request POST \
--url https://api.dify.ai/v1/form/human_input/{form_token} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"action": "approve",
"inputs": {
"attachment": {
"transfer_method": "local_file",
"type": "image",
"upload_file_id": "3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7"
},
"attachments": [
{
"transfer_method": "local_file",
"type": "document",
"upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee"
},
{
"transfer_method": "remote_url",
"type": "document",
"url": "https://example.com/report.pdf"
}
],
"feedback": "Looks good to ship",
"priority": "high"
},
"user": "abc-123"
}'
import requests
url = "https://api.dify.ai/v1/form/human_input/{form_token}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
payload = {
"action": "approve",
"inputs": {
"attachment": {
"transfer_method": "local_file",
"type": "image",
"upload_file_id": "3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7"
},
"attachments": [
{
"transfer_method": "local_file",
"type": "document",
"upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee"
},
{
"transfer_method": "remote_url",
"type": "document",
"url": "https://example.com/report.pdf"
}
],
"feedback": "Looks good to ship",
"priority": "high"
},
"user": "abc-123"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
const response = await fetch('https://api.dify.ai/v1/form/human_input/{form_token}', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"action": "approve",
"inputs": {
"attachment": {
"transfer_method": "local_file",
"type": "image",
"upload_file_id": "3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7"
},
"attachments": [
{
"transfer_method": "local_file",
"type": "document",
"upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee"
},
{
"transfer_method": "remote_url",
"type": "document",
"url": "https://example.com/report.pdf"
}
],
"feedback": "Looks good to ship",
"priority": "high"
},
"user": "abc-123"
})
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.dify.ai/v1/form/human_input/{form_token}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"action": "approve",
"inputs": {
"attachment": {
"transfer_method": "local_file",
"type": "image",
"upload_file_id": "3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7"
},
"attachments": [
{
"transfer_method": "local_file",
"type": "document",
"upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee"
},
{
"transfer_method": "remote_url",
"type": "document",
"url": "https://example.com/report.pdf"
}
],
"feedback": "Looks good to ship",
"priority": "high"
},
"user": "abc-123"
}',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.dify.ai/v1/form/human_input/{form_token}"
payload := strings.NewReader("{\n \"action\": \"approve\",\n \"inputs\": {\n \"attachment\": {\n \"transfer_method\": \"local_file\",\n \"type\": \"image\",\n \"upload_file_id\": \"3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7\"\n },\n \"attachments\": [\n {\n \"transfer_method\": \"local_file\",\n \"type\": \"document\",\n \"upload_file_id\": \"1a77f0df-c0e6-461c-987c-e72526f341ee\"\n },\n {\n \"transfer_method\": \"remote_url\",\n \"type\": \"document\",\n \"url\": \"https://example.com/report.pdf\"\n }\n ],\n \"feedback\": \"Looks good to ship\",\n \"priority\": \"high\"\n },\n \"user\": \"abc-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dify.ai/v1/form/human_input/{form_token}"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"action\": \"approve\",\n \"inputs\": {\n \"attachment\": {\n \"transfer_method\": \"local_file\",\n \"type\": \"image\",\n \"upload_file_id\": \"3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7\"\n },\n \"attachments\": [\n {\n \"transfer_method\": \"local_file\",\n \"type\": \"document\",\n \"upload_file_id\": \"1a77f0df-c0e6-461c-987c-e72526f341ee\"\n },\n {\n \"transfer_method\": \"remote_url\",\n \"type\": \"document\",\n \"url\": \"https://example.com/report.pdf\"\n }\n ],\n \"feedback\": \"Looks good to ship\",\n \"priority\": \"high\"\n },\n \"user\": \"abc-123\"\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'uri'
require 'net/http'
url = URI('https://api.dify.ai/v1/form/human_input/{form_token}')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = url.scheme == 'https'
request = Net::HTTP::Post.new(url)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = '{
"action": "approve",
"inputs": {
"attachment": {
"transfer_method": "local_file",
"type": "image",
"upload_file_id": "3c8fa1b2-7d4e-4f9a-b0c1-d2e3f4a5b6c7"
},
"attachments": [
{
"transfer_method": "local_file",
"type": "document",
"upload_file_id": "1a77f0df-c0e6-461c-987c-e72526f341ee"
},
{
"transfer_method": "remote_url",
"type": "document",
"url": "https://example.com/report.pdf"
}
],
"feedback": "Looks good to ship",
"priority": "high"
},
"user": "abc-123"
}'
response = http.request(request)
puts response.read_body