SharePoint integration in Athento
Athento allows you to connect a SharePoint site to import documents in two ways: via bulk import and via an interactive browser from the interface.
How to register the application in Azure
Before configuring the integration in Athento, it is necessary to register an application in Azure Active Directory.
Access the Azure Portal at portal.azure.com with a tenant administrator account.
Go to Azure Active Directory → App registrations → New registration.
Fill in the fields:
– Name: whichever you prefer, for example `Athento SharePoint`
– Supported account types: My organization only
Click Register. Once it is created, note the following values that you will need in Athento:
– Application (client) ID → this will be the Client ID
– Directory (tenant) ID → this will be the Tenant ID
Go to Certificates & secrets → New client secret. Assign a description and choose the expiration. Copy the value that appears in the Value column as soon as it is created, since it is only shown once. That value will be the Secret.
Go to API permissions → Add a permission → Microsoft Graph → Application permissions. Search for and add Sites.ReadWrite.All. Then click Grant admin consent so that the permission becomes active.
How to add the SharePoint configuration in Athento
Go to Team settings → Apps.
Find the SharePoint card and click Add.
Fill in the form:
– Client ID: the application ID obtained in Azure
– Secret: the secret created in Azure
– Tenant ID: the directory ID obtained in Azure
– Site URL: the SharePoint site URL in the format used by the Graph API. Starting from the browser URL, remove `https://` and replace the slash in the path with `:/`. For example, if the browser URL is `empresa.sharepoint.com/sites/documentos`, the value to enter is `empresa.sharepoint.com:/sites/documentos`. For the tenant root use `empresa.sharepoint.com:/`.
Click Add to save. Athento will automatically resolve the internal site identifier.
Once the configuration is saved, you can use the Check connection button to verify that the credentials are correct.
How to import documents on demand from SharePoint
This feature allows you to browse the folders of a SharePoint site and select documents to import them directly into an Athento Space.
From the destination Space document browser, click the upload dropdown and select Upload from SharePoint.
A modal will open with the SharePoint browser. You can:
– Browse folders by clicking on them
– Use the search to find documents
– Select one or more documents by checking the boxes
– Optionally choose a Form to assign it to the imported documents
Once the selection is made, click Upload. The documents will be downloaded from SharePoint and created in the Athento Space.
How to import documents in bulk
To import all documents from a SharePoint folder at once, schedule the bulk import command from /config/configuration/ → Add crontab config. Specify a Schedule (the frequency; see crontab.guru) and, in the Command field, type the command exactly as is, without python manage.py:
migrate_sharepoint_to_athentose_V2 --config-uuid <uuid-config> --serie <uuid-espacio> --folder-path "root:/NombreCarpeta:" --document-type <uuid-formulario>
Parameters:
– --config-uuid (required): the team’s SharePoint configuration (the one you created in Team settings → Apps).
– --serie (required): the destination Space where the documents will be created.
– --folder-path (optional): the path within SharePoint, for example root:/NombreCarpeta: (if omitted, from the root).
– --document-type (optional): the Form that will be assigned to the imported documents.
– --update (optional): reimports documents whose content has changed.
The first time, all documents are imported; in subsequent runs only the new ones are brought in (unless you use --update).
How to review errors
If the Check connection button returns an error, the most common reasons are:
– The Client ID, Secret or Tenant ID are incorrect.
– The Sites.ReadWrite.All permission does not have admin consent granted in Azure.
– The secret has expired and a new one must be generated in Azure.
If the bulk import fails with a Graph API error, the most common errors are access denied (permission not granted) or an incorrect folder path.