Import image via REST API

0
Hi, I’m trying to import an image with some data from an external website, I imported the name and email but when it came to the image I didn’t know how to do it. Here’s the database   and here’s the JSON structure   lastly, here’s the import mapping:
asked
2 answers
0

The image is saved as follow: 

 

answered
0

You will need to use the storeURLToFileDocument action in the Community Commons module on the Marketplace.

You will need to build the full URL as the user_image is missing the domain name and protocol, before you pass it into storeURLToFileDocument. You will also need to create an instance of your Image entity to pass into storeURLToFileDocument. This method doesn’t create thumbnails, but it does download the image and it’s usable in your application.

Hope this helps.

answered