Hi Prismic team,
We have two websites which use prismic. And I am currently working on a script to automate our backup process.
We have both Medium plan for these two sites, and I noticed that you already have an import/export feature. But there is no Api to call this one. So in order to automate as maximum, I am using Repository API to generate json files for my documents.
It works fine for this part, I can get all my documents from Repository API correctly. The problem is that when I make a .zip file for all json files and put it in import section. It will prompt errors on my json files saying that there is some errors in my json format. So I compared the document that I generated from API and the same document that I get from your official export feature. There is some differences.
For example:
A part of file from export feature
"image": {
"origin": {
"id": "my_image_id",
"url": "my_image_url",
"width": 1220,
"height": 721
},
"width": 1220,
"height": 721,
"url": "my_image_url?auto=compress,format",
"edit": {
"background": "transparent",
"zoom": 1,
"crop": {
"x": 0,
"y": 0
}
}
A part of file from repo API
"image": {
"dimensions": {
"width": 1220,
"height": 721
},
"alt": "xxxx",
"copyright": null,
"url": "my_image_url?auto=compress,format"
}
I am calling this endpoint to get my docs - > https://$repository.cdn.prismic.io/api/v2/documents/search?ref=$ref&access_token=$access_token&format=json&pageSize=1&lang=*
Do I miss something while exporting my docs or it is actually not possible to import files that are generated by Repo API?
Thanks a lot for your help!
Best Regards,