I am trying to post a image to Pinterest using their SDK (PDK). The specific method I am using is
PDK.request('/pins/', 'POST', { board: board.id, note: "description", link: "link", image_base64: "" }, function(e){ console.log(e); });
There are three options to send the image.
- sending the image_url in the options object.
- sending the image_base64 (data url) which is what is shown in my code
- using a multipart form data
I can only use options 2 and 3. For options 2 it works for small images until the dataURL gets too big. Pinterest API does not have any helpful errors when this occurs and this is only my speculation.
The alternative is to use a multipart form data but I am not sure how to do that.
Can someone help me posting using the multipart form data for image posting?
I also couldn't make their SDK work, but I've sorted this out, at least for dataurl:
Hope it helps.