Command line connection to notes database to put or get a file

I have a simple task that I need to automate. I want to be able to launch a terminal window on mac and type a command to connect to a lotus notes team room with my credential and then insert a document there or get a document from the team room. Does this make any sense to anyone at all, is there a way to do it? API for any programming language? or maybe connecting to db2 from command line to get and put a document?

Hi Susan

You can use REST Api for the same.

do you have a link to REST API documentation for this? Does it require special roles ? can any end user use it?

Search for Domino Access Services for the REST API. It may not be obvious how to add an attachment, but basically you would create the MIME inside JSON for the rich text field to hold the attachment and then do a PATCH with the attachment in BASE64 encoding. Security is normal Domino web security, which means slightly different things depending on which version of Domino you are running.

Best case is to retrieve the document with the rich text field there, then modify and PATCH to put it back. You can't use the HTML version, only the MIME version for attachments.

This would probably be best implemented using a short JavaScript file and Node.js. You would need to have the AppDev Pack 1.0.2 or higher (I think, I'm sure in 1.0.3) installed and PROTON server task running, but it would allow easy command line access to this sort of task.

See https://doc.cwpcollaboration.com/appdevpack/docs/en/homepage.html for more information on the AppDev Pack. I've been playing with it recently, and it is a bit complicated to set up with security, but doable.

Neither the Domino server nor the Notes client come with any "out-of-the-box" tools that allow you to easily/quickly do that. The best answer will depend a lot on your local Mac toolchain.

For the "insert", do you intend to type the incoming data on the command line or are you picking it up from a file or other source? Similarly for the "get", do you need to simply display output on the command line or is there another final destination?

If you want to do this through terminal windows you may need to have an command line HTTP client such as cURL and then you can use rest API to authenticate and post the document.

https://www.ibm.com/developerworks/community/files/form/anonymous/api/library/82e137de-50a2-4dc0-b648-4644afb7225e/document/af8634fb-6a43-47f6-ba46-47ae592a3d87/media/1.%20Domino%20Access%20Service.pdf&ei=zDNnVL9Cjc9ox8uByAc&usg=AFQjCNGQFBnw8PHH3iROM12wseKgzmQEUg&sig2=RpfQlhjdLx3DXjpWfYVyiw

You should be able write all of the command using shell script as well.