InterSystems health connect interface to transfer files to SharePoint
hi everyone
we are migrating a legacy script that uploads the files to a SharePoint site through webdav to Health Connect engine.
I wonder if anyone has ever done that, if yes, what did you do to achieve this?
thanks in advance,
Frank
Comments
To transfer files to SharePoint via InterSystems Health Connect, you can use SharePoint's REST API through InterSystems HTTP operations. Here's a potential approach:
HTTP Operations to Interact with SharePoint:
- You can leverage HTTP requests to interact with SharePoint APIs directly. Examples include operations to upload, delete, or retrieve files using API endpoints such as
GetFolderByServerRelativeUrlorFiles/add[1].
- You can leverage HTTP requests to interact with SharePoint APIs directly. Examples include operations to upload, delete, or retrieve files using API endpoints such as
OAuth2 Authorization:
- SharePoint's API requires OAuth2 authorization. You can use InterSystems' built-in mechanisms to handle OAuth2. This involves using methods like
GetAccessTokenClientorAddAccessTokento include the access token in HTTP headers for authenticated API calls [1].
- SharePoint's API requires OAuth2 authorization. You can use InterSystems' built-in mechanisms to handle OAuth2. This involves using methods like
Data Handling:
- For file uploads and downloads, InterSystems stream containers such as
Ens.StreamContainercan handle binary data streams. For example, creating a binary stream for file uploads and setting it as theEntityBodyin your HTTP request [1].
- For file uploads and downloads, InterSystems stream containers such as
Additional Documentation and Examples:
- InterSystems provides tools to simplify HTTP requests and responses, including reusable templates for request formatting. This approach can generalize integration patterns not just for SharePoint but for other APIs [1].
This method would align with migrating scripts and ensuring interoperability via Health Connect. If you'd like further examples or assistance, you may want to consult InterSystems Developer Community. [1]
Sources:
The bot answered my question fine
If you need any help with the example api let me know, annoyingly teams didn't record the audio and i haven't had time to re-record it along with the second version of the code we created