particle-iot / cloud

A place to discuss issues, enhancements, features for: API, Cloud Compiler, Web IDE (Build), Webhooks, Console, and Device Setup
2 stars 0 forks source link

Unable to upload product firmware using cloud API, unexpected field error #33

Closed rickkas7 closed 6 years ago

rickkas7 commented 6 years ago

Bugs

Expected behavior

I don't seem to be able to use the Cloud API for uploading a product firmware binary as described here. I get an unexpected field error.

Observed behavior

If I pass what I believe to be a valid request, I get an unexpected field error:

$ curl -X POST "https://api.particle.io/v1/products/1319/firmware?access_token=1234" -F file=@13subscribetest.bin -F version=25 -F title="cloud upload test"
{"ok":false,"error":"Unexpected field"}

Steps to reproduce

If I leave the "file" field out, then I get an error that it must be specified:

$ curl -X POST "https://api.particle.io/v1/products/1319/firware?access_token=1234" -F version=25 -F title="cloud upload test"
{"ok":false,"code":400,"error":"You must specify a file"}
monkbroc commented 6 years ago

Nice find! I had to dig through the API code to figure out that the correct parameter name is binary not file. I'll update the docs.