Creating A Deploy via API

I’ve tried to deploy the site and then upload the files via api as documented here: https://www.netlify.com/docs/api/

However when I create the upload with the same body as the example, I’m only returned the required functions and not the required files. I’ve tried changing the example to no avail.

Here’s the relevant response:

required"=>[], "required_functions"=>["708b029d8aa9c8fa513d1a25b97ffb6efb12b423"]

and the json I sent:

"files": {"/index.html": "708b029d8aa9c8fa513d1a25b97ffb6efb12b423"}, "functions": {"hello-world": "708b029d8aa9c8fa513d1a25b97ffb6efb12b423"}

Any ideas?

can you provide your Netlify instance name please?

My team name is ardensol, is that what you’re looking for?

The site is: https://c98c0f72-3ab2-4fd6-be39-4bb0f305255d.netlify.com

Checked again this morning, still seem to be having the issue.

So I was able to fix it by not include the /, your docs make it seem like the / is required for filenames so might be good to change it for the post request.

1 Like

For posterity, another issue was that I didn’t close the file so was reading blank data into the SHA1 function which I imagine isn’t required.

thanks much for that feedback and for the solutions, @ardensol! We really super-double-plus appreciate followups like these so that future explorers can also benefit from your learning :smiley:

Friendly request, please update your documentation here because it still has the slash / in it.

Heya, I just spent some time trying to replicate this and was able to deploy via curl with a / before index.html. I’m wondering if you have an error log or a site URL we can take a look at to try to understand why it may sometimes work with / and other times not. That’ll be important before we request an update from our docs team. Thanks for your help getting to the bottom of this!