I’m writing articles in Notion. I want to transmit the articles from Notion to Medium.
Yesterday, I created my first workflow. When I click on Test Workflow the PipeDream site shows me this error:
Error
Request failed with status code 400
DETAILS
at null.createError (/tmp/__pdg__/dist/code/f614438254758c8fa7d91453664046c0edf28e7106a96c10aa37493482c960b2/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/createError.js:16:15)
at null.settle (/tmp/__pdg__/dist/code/f614438254758c8fa7d91453664046c0edf28e7106a96c10aa37493482c960b2/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/tmp/__pdg__/dist/code/f614438254758c8fa7d91453664046c0edf28e7106a96c10aa37493482c960b2/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/adapters/http.js:269:11)
at IncomingMessage.emit (events.js:412:35)
at null.endReadableNT (internal/streams/readable.js:1333:12)
at process.processTicksAndRejections (internal/process/task_queues.js:82:21)
ExportsInputsLogsDetails
steps.medium_create_post{1}
Under Select Event I clicked try Now and I changed something in the Notion page.
PipeDream displays 1 New Event.
So it looks like PipeDream was able to detect my Notion page changed.
First off, welcome to the Pipedream community. Happy to have you!
A 400 error means that the data you’re sending to an external API doesn’t match what that API is expecting.
Please refer to the API’s documentation and the error message in the response from the API for more details to narrow down which part of the payload is missing or is malformed.
You might be able to find more data in the Logs section of the step.
Does Page ID refer to the Notion “web link” under the Share function?
I assume “invalid_request_url” refers to page_id which refers to Notion page web link.
How can I get the page_id from the previous step?
I guess I’d use the reference similar to the one I saw in your video for the call to PagetoMarkdown: steps.get_new_blog_post.$return.results[0].id. Correct?
But, the previous step needs to return the page_id. I’d have to look at that action code to make sure it returns the page id.
Also, I want to display messages at each steps of the action code using a print or alert type function, so I can see where the code is failing. How do I do that? I added print and alert and I get an error that those two functions are not defined.