Referencing the docs at:
I want to send an image from a client to the Workflow.
I see the snippet but it is for a STRING to be sent as data but not sure how to send using an image png as a binary object.
import requests
import json
url = "https://app.scade.pro/api/v1/scade/flow/75929/execute"
payload = json.dumps({
"start_node_id": "start",
"end_node_id": "end",
"result_node_id": "end",
"node_settings": {
"start": {
"data": {
"img": {STRING}
}
}
}
})
headers = {
'Authorization': 'Basic {ACCESS_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
I’m using Python Requests so I have tried to send using files
but that doesn’t seem to be read by the server.
UPDATE: What does work is referencing a URL of the image then getting an imgflip URL as a return such as:
"result": {
"data": null,
"img2": "https://i.imgflip.com/4zcvfa.jpg",
"inputs": null,
"success": {
"data": null,
"img2": "https://i.imgflip.com/4zcvfa.jpg",
"inputs": null
}
},
img2
is my return variable.