Make not properly handling Pinterest multi image pins

:bullseye: What is your goal?

To use Pinterest module to pin multiple images on the same Pin.

:thinking: What is the problem & what have you tried?

I’m getting the following error:
type RuntimeError
message [400] {“code”:1,“message”:“Invalid request: ‘’ does not match ‘^\\d+$’ (constraint: pattern=^\d+$)”}

I’ve tried to map the images to an array I send trough API, I’ve tried mannually set just 2 extra images, I’ve tried to manually define two image URLs (without mapping any variables).

In all these cases, I still get the error above.

The single-image pin works properly, and so do all other API calls.

:clipboard: Error messages or input/output bundles

[
{
“link”: “https://www.etsy.com/listing/4401164726/framed-canvas-vanlife-under-the-sun?ls=r&ref=hp_recent_activity_hub-3&sr_prefetch=0&pf_from=home&content_source=3dce37417aa5407c28828799111ab314%253ALT4a16f2ba2f24b8f924d26d5060797111471597b7&logging_key=3dce37417aa5407c28828799111ab314%3ALT4a16f2ba2f24b8f924d26d5060797111471597b7”,
“title”: “Framed canvas “Vanlife under the sun” – Minimalist camping art”,
“board_id”: “286119451265406414”,
“description”: “:sun_with_face: Experience the moment – adventures on the big screen Freedom, sun, mountains, campfire – this minimalist mural “Vanlife under the sun” perfectly captures the spirit of camping and nature. A van stands next to a tent, framed by fir trees and mountains, while the golden sun warms the sky – a design that conveys both tranquility and a sense of adventure. Each canvas comes with a high-quality pine wood floating frame – fully assembled, easy to hang and durable in appearance. :yellow_heart: Perfect for anyone who loves the feeling of freedom, nature & van life – whether at home, in a camper or in the office. :sparkles: Why customers love this artwork :white_check_mark: Unique vanlife motif: Combines nature, freedom and minimalism. :white_check_mark: Premium quality: 344 g/m² canvas fabric with a fine structure – clear lines, rich colors.”,
“media_source”: {
“index”: 0,
“items”: [
{
“url”: “https://i.etsystatic.com/40164986/r/il/4239eb/7420603339/il_794xN.7420603339_c8b0.jpg”,
“title”: “test”
},
{
“url”: “https://i.etsystatic.com/40164986/r/il/8a37b1/7420603725/il_794xN.7420603725_nfn9.jpg”,
“title”: “lla”
}
],
“source_type”: “multiple_image_urls”
},
“board_section_id”: “”
}
]

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Looks like one of the variables (maybe “Board Section”) is empty?

You can default it to a default value. To do this, you can use the built-in function:

Here’s an example of how you can use this function:

{{ ifempty(4.section; "0") }}

(copy-paste the above into the field, or type it exactly as shown)

Hope this helps! If you are still having trouble, please provide more details.

@samliew

Thanks, I’ll try it.

The Board section IS empty but per their API documentation it can be and also is a string not a number. Also if this would be a problem the single image process wouldn’t work either.

Anyway I’ll do this for all variables just to eliminate the possibility that they might do multi image validation differently.

Will let you know, cheers.

Found a solution thanks to @samliew.

For some reason, when the value is empty Make still sends the variable to Pinterest in this case. And since the value is sent Pinterest validates it. But as soon as that happens, validation fails even though in the documentation is OK to not have it. I guess validation is a bit more strict in this case.

So I just make sure that if the board section is empty it doesn’t get set at all, which is kind of annoying since I need to have another branch. But at least now it works.

2 Likes