Microsoft Service¶
Présentation¶
Le service Microsoft permet d'intégrer OneDrive (stockage cloud) et Outlook (emails) dans vos automatisations AREA.
Authentification : OAuth2 (Microsoft Identity Platform)
Configuration OAuth¶
Créer une application Azure AD¶
- Accédez au Azure Portal
- Allez dans Azure Active Directory > Inscriptions d'applications
- Cliquez sur Nouvelle inscription
- Remplissez :
- Nom : AREA Microsoft Integration
- Types de comptes : Comptes personnels Microsoft uniquement
- URI de redirection :
http://localhost:8081/services/callback - Notez l'ID d'application (client)
- Dans Certificats et secrets, créez un nouveau secret client
Variables d'environnement¶
Scopes requis¶
| Scope | Usage |
|---|---|
| Files.Read | Lire les fichiers OneDrive |
| Files.ReadWrite | Écrire les fichiers OneDrive |
| Mail.Read | Lire les emails |
| Mail.Send | Envoyer des emails |
| User.Read | Informations utilisateur |
| offline_access | Refresh tokens |
Actions OneDrive¶
onedrive_new_file¶
Déclenche quand un nouveau fichier apparaît dans un dossier OneDrive.
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| folder | string | Non | Dossier à surveiller (défaut: racine) |
{
"actionService": "microsoft",
"actionType": "onedrive_new_file",
"parameters": {
"folder": "/Documents"
}
}
onedrive_file_modified¶
Déclenche quand un fichier est modifié dans OneDrive.
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| folder | string | Non | Dossier à surveiller |
{
"actionService": "microsoft",
"actionType": "onedrive_file_modified",
"parameters": {
"folder": "/Projects"
}
}
Actions Outlook¶
outlook_new_email¶
Déclenche quand un nouvel email arrive dans Outlook.
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| from | string | Non | Filtrer par expéditeur |
| subject | string | Non | Filtrer par sujet |
{
"actionService": "microsoft",
"actionType": "outlook_new_email",
"parameters": {
"from": "boss@company.com"
}
}
outlook_email_important¶
Déclenche quand un email marqué comme important arrive.
Aucun paramètre requis.
Réactions OneDrive¶
onedrive_upload¶
Upload un fichier vers OneDrive.
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| path | string | Oui | Chemin de destination |
| content | string | Oui | Contenu du fichier |
| filename | string | Oui | Nom du fichier |
{
"reactionService": "microsoft",
"reactionType": "onedrive_upload",
"parameters": {
"path": "/Backups",
"filename": "log.txt",
"content": "Contenu du fichier"
}
}
onedrive_create_folder¶
Crée un dossier dans OneDrive.
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| path | string | Oui | Chemin du dossier à créer |
{
"reactionService": "microsoft",
"reactionType": "onedrive_create_folder",
"parameters": {
"path": "/Projects/NewProject"
}
}
Réactions Outlook¶
outlook_send_email¶
Envoie un email via Outlook.
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| recipient | string | Oui | Adresse du destinataire |
| subject | string | Oui | Sujet de l'email |
| body | string | Oui | Corps du message |
{
"reactionService": "microsoft",
"reactionType": "outlook_send_email",
"parameters": {
"recipient": "colleague@company.com",
"subject": "Notification",
"body": "Message automatique"
}
}
Exemples d'AREA¶
Backup automatique¶
{
"name": "Backup journalier",
"actionService": "timer",
"actionType": "interval",
"reactionService": "microsoft",
"reactionType": "onedrive_upload",
"parameters": {
"interval": 86400000,
"path": "/Backups",
"filename": "daily-log.txt",
"content": "Backup effectué"
}
}
Notification par email¶
{
"name": "Notification nouveau fichier",
"actionService": "microsoft",
"actionType": "onedrive_new_file",
"reactionService": "microsoft",
"reactionType": "outlook_send_email",
"parameters": {
"folder": "/Shared",
"recipient": "me@example.com",
"subject": "Nouveau fichier partagé",
"body": "Un nouveau fichier a été ajouté dans le dossier partagé."
}
}