I'd like to publish an api that returns an image as well as a number, but it seems that the docs for APIFunction specifies only a single possible format type:
Here's an example to play with:
randomClock[t_] := Rasterize[Graphics[Rotate[ClockGauge[t][[1]],
RandomReal[{0, 2 \[Pi]}], {0, 0}], ImagePadding -> 0], ImageSize -> 300];
randomClockDeploy[] := With[{t = RandomChoice /@ Range /@ {12, 60, 60}},
{randomClock[t], t}]
CloudDeploy[APIFunction[{}, randomClockDeploy[] &], Permissions -> "Public"]
This returns:
So what I'm looking for would be something akin to:
CloudDeploy[APIFunction[{}, randomClockDeploy[] &, {"PNG","String"}], Permissions -> "Public"]