In order to create record in bulk using REST API, we using Composite Tree resource.
I'm trying to upload a bulk of content versions :
{"records" :[
{
"attributes" : {"type" : "ContentVersion", "referenceId" : "ref1"},
"VersionData":"/9j/4AAQSkZJRgABAQEAYABADn/2Q==",
"PathOnClient":"Array1.jpg",
"Description":"Array1"
},
{
"attributes" : {"type" : "ContentVersion", "referenceId" : "ref2"},
"VersionData":"/9j/4AAQSkZJRgh25==",
"PathOnClient":"Array2.jpg",
"Description":"ARRAy2"
}
]
}
Using endpoint: https://SandboxName.my.salesforce.com/services/data/v43.0/composite/tree/ContentVersion.
My questions are:
- The Response when everything handled fine is :
{ "hasErrors": false, "results": [ { "referenceId": "ref1", "id": "0680Q0000006OSwQAM" }, { "referenceId": "ref2", "id": "0680Q0000006OSxQAM" } ] }
But in Case we have one error on one of the files - I'm getting the next response:
"results": [
{
"referenceId": "ref2",
"errors": [
{
"statusCode": "SOME ERROR",
"message": "SOME ERROR",
"fields": [
"SOME FIELD THAT GET THE ERROR"
]
} ]
BUT what happened to the other files that actually succeeded?
If there is one error on one of the files, Does it make it all fail? Even if they were succeeded?
If it does, Is there another method that I can upload a bulk of Content Version using REST API?
2.What about the size limit of Content Version in MB that I can upload with this approach? What is the max size that this API can handle with? I made a test and I succeed to upload files with a sum of 16 MB via this API - But I couldn't create a blob version more than this - It just caused my computer to stop working