Describe the issue/error/question
POST request gives error in Integer field when creating posts in WordPress
Hi, I am using an HTTP request to post data into WordPress. This node was actually fine before I updated to n8n latest version.
the field is converted to integer using the snippet: {{parseInt($item(0).$json[“cat”])}} but when trying to POST into the respective field “post_category” (I tried also to manually by adding static value as integer to test), but still keep getting same error.
I get the following error:
What is the error message (if any)?
{
“status”: “rejected”,
“reason”: {
“message”: “400 - {“code”:“rest_invalid_param”,“message”:“Invalid parameter(s): post_category”,“data”:{“status”:400,“params”:{“post_category”:“post_category[0] is not of type integer.”},“details”:{“post_category”:{“code”:“rest_invalid_param”,“message”:“post_category[0] is not of type integer.”,“data”:null}}}}”,
“name”: “Error”,
“stack”: “Error: Request failed with status code 400 at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:539:35) at endReadableNT (node:internal/streams/readable:1345:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)”
}
}
Please share the workflow
Anyone has this error recently? Thank you very much in advance.
(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)
Share the output returned by the last node
Information on your n8n setup
- n8n version: 0.177.0
- Database you’re using (default: SQLite):
- Running n8n with the execution process [own(default), main]:
- Running n8n via [Docker]