Pinterest HTTPS node - json body error

Describe the problem/error/question

I am trying to send a POST request to “Create a Pin” but the JSON body is not formatted properly.

This is documentation on the cURL for pinterest API:

This is the HTTPS node I’m using (authentication is correct):

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

“id”: “0291155e-64ba-4d48-8590-6f58d669ac19”,
“name”: “7 ways to use AI”,
“property_publishing”: “AI”,
“property_type”: “type”,
“property_media”: [
“property_topic”: “AI”,
“property_sub_topic”: null,
“property_post_link”: null
“pinterestPin”: “This is a test \nThis is 21 2 \@pinterest\nThis is line 4\n• sdasadsd\n\nHi\n1. dfsjlkfjdsfl\n2. fdslkjlkdsjfldsf\n\n👋\nsklajdsakjhd\nhttps://www.pinterest\n\n\#pinterest\nd2323d\n\nIntroduction\nArtificial Intvdfnce \(AI\) has revolutionized numerous industries with its ability to perform tasks that traditionally required human intelligence. In recent years, AI has also made significant advancements in the creative field. From assisting with content creation to enhancing the overall creative process, AI”

Information on your n8n setup

  • **n8n version:**1.21.1
  • Database (default: SQLite):
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):**own
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**Docker
  • Operating system:

Hey @pooria,

Just to check is the data coming out of the node before the http request the json data you have pasted as that has some issues it is 2 items but each item doesn’t contain all of the fields so on the second item run it would throw an error.

It looks like you may also need to tweak how you are sending the data as you are using an expression but without actually using an expression. The JSON in your example body is also showing as invalid on it looks like board_id value is not properly quoted. It also looks like you are trying to send media_source as an array but the Pinterest docs show it as an object.

I would maybe try with something like the below and tweak from there.

Thx @Jon.

Guessing that works but you’re right the second json is throwing errors.

I’ll create a separate post for why that is

@Jon any tips on how to access the second item using JSON expressions?

Hey @pooria,

I think I have answered that one now :slight_smile: I am still catching up and we still have members of the support team on leave so it may take me a bit longer than normal to get to some posts.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.