Using the dashboard is straightforward enough. But I’d like to test scripts in the sandbox, and then deploy debugged scripts to all my tenants as part of my build/release process. This would be nicer than a bunch of cutting and pasting.
I haven’t tried updating a connection with a custom DB script via the management API, but when you get the JSON document for a connection, the custom DB scripts are in the customScripts object under the options object:
"customScripts": {
"get_user": "function getByEmail(name, callback) {\n ...
"login": "//when you log in, connect to the LDAP with your ...
},
Note that each script is formatted as a single long string with embedded newlines. You could try hitting the /patch_connections_by_id endpoint with a new "options": { "customScripts": { "get_user": ... payload.