Hello s a,
If you replace -APIFunction- by -FormFunction- a working userinterface is ready to use. I assume you insist on doing this via a API.
Here is my public API definition with name: picapi.
CloudDeploy[ APIFunction[{"image" -> "Image"}, ImageIdentify[#image] &, "PNG"], "/picapi", Permissions -> "Public"]
To send a picture to this API you need a link to send it to:
http://www.wolframcloud.com/objects/mpg/picapi
note the -mpg- part that replaces the user-UUID part. This is a setting in you wolfram cloud web user interface. Configure your own abbreviation.
Now test the API with the Postman REST Client (getpostman.com)
Send it and this worked for me.
If you want to turn this manual test into code you should implement code like this
POST /objects/mpg/picapi HTTP/1.1
Host: www.wolframcloud.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="1a11447a8b55b94e.png"
Content-Type: image/png
----WebKitFormBoundary7MA4YWxkTrZu0gW
you need a multipart/form-data description. Normally the URLFetch command is able to send this but with pictures it is more difficult. Need to investigate a little further if it can be done.