Workflow log events 'No Content(empty input stream)' error.

Hi all,

Thanks in advance for any light you can shed on the issues that I am facing.

I have implemented the OAuth workflow and am passing the access token as a bearer token as a header. This workflow works for other endpoints that I have previously implemented. This is the endpoint I am PUT requesting to:

/automation/v3/logevents/workflows/<workflow_id>/filter

Am I correct in assuming that the following url’s ‘workflow_id’ would be ‘2106109’ or would it be ‘2106109/flow/3136415’?

URL: Automation UI Canvas

This is the documentation that I am following from:

https://developers.hubspot.com/docs/methods/workflows/log_events

I am a bit confused as to why it would be a ‘PUT’ request and not a ‘GET’ request as no data is being updated on the server. That small issue aside, these are the filters I am passing as the request body:

request_parameters = {
‘types’: [‘COMPLETED_WORKFLOW’],
‘offset’: ‘1548979200’,
‘limit’: 1546300800
}

No matter what types I pass the content is always empty. I have also tried without ‘offset’ and ‘limit’ filters. Yes, this workflow is active and has had multiple deals pass through it everyday for the last 6 months or so.

Here is the error json that is returned:

{“status”:“error”,“message”:“No content (empty input stream)”,“correlationId”:“f18408cb-2aeb-432a-8607-bd4b4dad109e”,“requestId”:“44248fa6d01adbebec5d370039d53a3c”}

Could someone point me in the right direction?

Cheers,

James.

Welcome, @CoderAcademy.

Happy to clarify. 2106109 is actually Coder Academy’s Hub ID. The workflow ID you want to use is 3136415.

That request body is registering as invalid JSON for me since it contains single quotes. Also, the timestamp values don’t need quotes around them.

I just tried this request and it returned successfully for me:

PUT https://api.hubapi.com/automation/v3/logevents/workflows/3136415/filter

{
 "types": ["COMPLETED_WORKFLOW"],
 "offset": 1548979200,
 "limit": 1546300800
}

Let me know if you’re still seeing issues with this formatting.

Thank you for your time with this issue. This is my code:

def workflow_history(workflow_id):
try:
#Access token will be None if cookie does not exist.
access_token = request.cookies.get(‘hubspot_access_token’)
except Exception as error:
return redirect(url_for(‘authenticate_hubspot’))
domain = ‘https://api.hubapi.com
endpoint = ‘/automation/v3/logevents/workflows/{0}/filter’
request_url = domain + endpoint.format(workflow_id)
request_headers = {
“Content-Type”: “application/json”,
“Authorization”: "Bearer " + str(access_token)
}
request_parameters = {
“types”: [“ENROLLED”]
}
try:
put_request = requests.put(
request_url,

headers=request_headers,
params=request_parameters
)

Hi, @CoderAcademy.

Sorry, I’m not sure what to do with that code. What error are you receiving?