Status Code: 417Response Text: ERR: Expected hex 0x in '{0}'.

Status: Open · Asked by martexx on · 0 views

martexx — Question ·

When i try to upload a file i received in a pabbly email parser i get this error, only happens with the file url from pabbly.
Status Code: 417
Response Text: ERR: Expected hex 0x in '{0}'.

import requests
from urllib.parse import urlparse

# Set the filename manually or extract it from the URL
manual_filename = f'1. Subject : introductie Rianne2 {{pc_local_date_now}}.pdf'

# API URL for file upload
upload_url = 'https://private31527/ExternalApi/api/CrewingDocumentsContent/UploadFile'

# API headers
headers = {
'Accept': 'application/json',
'apiKey': '{{PrivateTransafeKey}}'
}

# Form data
data = {
'EntityID': '{{3. Result : RiannerIntroductieIDnr}}'
}

# File download URL (direct download link from Google Drive)
file_url = 'https://pcmailhook.com/attachments/2025/01/01/xxx562_03.10-Introduction-for--on--completed-on-.pdf'

# Download the file
file_response = requests.get(file_url)

if file_response.status_code == 200:
# Use the manually set filename
filename = manual_filename

# Prepare the file for upload
files = {'File': (filename, file_response.content)}

# Send the POST request to upload the file
response = requests.post(upload_url, headers=headers, data=data, files=files)

# Output the response
print(f"Status Code: {response.status_code}")
print(f"Response Text: {response.text}")
else:
print(f"Failed to download the file. Status code: {file_response.status_code}")

the same happens if i make it in a normal api call

Arshil Ahmad — Reply ·

Hi @martexx,

Could you please share the Workflow URL where you have encountered this issue?

martexx — Reply ·

but you can see it in the run history, even though it looks like a success it was not

Task History ID -

IjU3NjUwNTZmMDYzNjA0M2Q1MjZjNTUzYzUxMzE1MTY0NTQzODBmMzAi_pc

Executed at

Jan 03, 2025 11:21:30, (UTC+00:00) America/Danmarkshavn

martexx — Reply ·

It seems to work now after am afternoon of errors.
I am still curious on the why Soni can deal with it when needed.

Arshil Ahmad — Reply ·

Thank you for the update. We are glad the issue has been resolved. Kindly monitor your workflow for some time, and if you encounter the "Response Text: ERR: Expected hex 0x in '{0}'" error again in step 8, please let us know.

It seems to work now after am afternoon of errors.
I am still curious on the why Soni can deal with it when needed.

As of now, we don't know the reason why you encountered that error, so we won't be able to comment on it.

martexx — Reply ·

Lets hope it stays in a working condition

Back to all forum threads · Log in to reply