Thanks for your feedback. I’ve created task DOC-7809 and we will add samples for each REST API endpoint.
Regarding contents, we are indeed in the process of specifying this precisely using a JSON schema, but this will ship only in 7.0 of the product (and so it’s not of immediate help to you). Please see MB-41236 - the schema in 7.0 can be seen in these files:
Schema for handler
Schema for bindings of handler
Schema for settings of handler
Schema for a list of handlers
However, as 7.0 is not yet released, in older versions of the product, my suggestion would be to create a small handler from the Couchbase UI and read the object out using GET /api/v1/functions/fn_name then modify the resulting object and write it back using POST to the same location. This way, all necessary fields will be prefilled.
Finally, the function name appearing on the URL of POST to /api/v1/functions/fn_name, and the function name appearing in the body of the POST message must match, failing which you’d get the error message seen.
If you encounter any problems, don’t hesitate to ping us here on forums.