etoxin etoxin - 21 days ago 9
Javascript Question

Create a new Pin with the Pinterest Javascript SDK

I'm trying to create a new Pinterest Pin with the PDK JS api (https://developers.pinterest.com/docs/sdks/js/).

PDK.pin({
image_url: ImageUrl,
note: Description,
link: ShareUrl
}, function(res){
console.log(res);
});


It makes the request but none of the params (image, link and note) seem to pass to the api. A working example of the pinterest share pdk working can be found on this website: http://www.vogue.com/13382189/fair-isle-sweaters-runway-christmas-style/

Answer

I found out that the site was making a pin like so:

window.open(
    'https://www.pinterest.com/pin/create/button/?url=' + data.pdkShareUrl + '&media=' + data.pdkImageUrl + '&description=' + data.pdkDescription,
    'share',
    'width=600, height=300'
);