I have a project in which we need to create 1000 product pages. The client has all data in a spreadsheet and I have had success using the Migration API (though only 1 document per second )
However, how do I add images for each page? I know I can reference an image by its ID, but how do we find that ID after upload to the Media Library? And how can I make sure the images are centered and resized properly?
To get the IDs of images uploaded to the Media Library, you can click on an image and copy the image’s ID from its URL. You can then map these IDs to the documents as needed when you're migrating them, like in this example body structure from the documentation: Migration API Technical Reference - Documentation - Prismic.
The sizing and centering of images would have to be done separately, or by using Imgix URL parameters, for example:
- Resize:
?w=500&h=500&fit=crop
- Focus:
&crop=focalpoint&fp-x=0.5&fp-y=0.5
https://your-repo.cdn.prismic.io/media/{image-id}?w=500&h=500&fit=crop
Let me know if you have any other questions