Site name: webase-test.netlify.app
Hey guys! First timer here! Excited to be working on an integration with WeBase [1] and Netlify!
Currently doing everything through the API. I am following the documentation here: Get started with the Netlify API | Netlify Docs
I start by creating a deploy:
POST https://api.netlify.com/api/v1/sites/5d713f3e-5c43-40b0-a705-5915911492ee/deploys
Sending this as the body:
{"files"=>{"/index.html"=>"a7a12da81336a3b36e58c720dd3c2c69ae5029da", "/home-ae89e0e2-8356-4f62-a171-163475c29300.html"=>"a7a12da81336a3b36e58c720dd3c2c69ae5029da", "/assets/application.css"=>"efba3e5593fa6314922a1de5d81348cdf1bf6a17", "/assets/apps.css"=>"dedb59b0be1857fbdc789394cd44ade71b8b7011", "/assets/websites.css"=>"3c8c0b46f9619c23aba78d27490f5f042a2d81e2", "/assets/pattern.css"=>"ea8d77b0ffc7fdc095e3dba87782d63e6331331c"}, "draft"=>false}
I get a 200 back with an deploy ID.
Next I try to upload this files. This is where I hit an issue. I upload 5 files (I skip one because it is the same file). And the first 4 uploads seem to fail
I am doing a PUT to:
https://api.netlify.com/api/v1/deploys/5fb01594c40d47a86f572674/files/index.html
with the contents of the file as the body.
Each request fails except for the last one with the following message:
{“code”=>422, “message”=>“No records matched”}
The last one… in this case the PUT to:
https://api.netlify.com/api/v1/deploys/5fb01594c40d47a86f572674/files/assets/pattern.css
Always succeeds.
It is making me think there is an issue with the order. But I am really not sure. The content of the body of the file upload is the same string I use to create the SHA1 digest that I send when creating the deployment.
It just seems odd that the last one works and the others ones fail. Also I can’t see anything in the Build console on the Netlify site.
Any tips or pointers here? Would love to see a fully running site that is 100% automated through the API!
Thank you for any help! Happy Saturday!
–harris