S3
Using the Leviia S3 API - Python
To manage your S3 objects and buckets at Leviia (in Python), you need the following library : https://github.com/boto/boto3 You can install it with the following command : pip install boto3 Start by building a customer object : import boto3 access_key = <VOTRE_ACCESS_KEY> secret_key = <VOTRE_SECRETE_KEY> url_s3_leviia = 'https://s3.leviia.com' s3 = boto3.client(service_name='s3', aws_access_key_id=access_key, aws_secret_accesFew readersManage your Storag3 identifiers via API
| 1) CREATE AN API TOKEN IN THE LEVIIA DASHBOARD Using the API requires a valid token. Go to your Leviia Dashboard, then open the “API Tokens” menu. Click the “Create a token” button, choose a description (to identify it easily later), and set an expiration date. . Curl installation : Whatever your platform, there's a good chance that the Curl binary will be ported for it, so install it : https://curl.se/download.html. Once Curl is installed, use the following commands, replacing USER with your user name and PASSWORD with your application password. Send a file to Leviia : `Few readersUsing the Leviia Drive API - PHP
Installing PHP and its dependencies : To install PHP on your environment, go to: https://www.php.net/manual/fr/install.php. Once your PHP environment is up and running (hello-world.php is up and running), install php-curl and SabreDAV (WebDAV client for PHP). Here's an example, to be adapted to your environment, under Linux (Debian) : apt update apt install php-curl composer require sabre/dav ~3.2.0 Click here for SabreDAV documentation : https://sabre.io/dav/install/. YFew readersUsing the Leviia Drive Pro API - Python
Initialization : This part of the code must be at the beginning of your program. import json import requests domain = "cloud.leviia.com"; # Your pro domain auth=('antoine', 'password'); # admin user headers = {"OCS-APIRequest": "true"} Replace "domain", "antoine" and "password" with your domain name, username and password. Create a user :Few readersUsing the Leviia Drive API - Python
Initialization : This part of the code must be at the beginning of your program. import xml.etree.ElementTree as ET; import requests; domain = "cloud.leviia.com"; auth=('user', 'password'); url = "https://"+domain+"/remote.php/dav/files/"+auth[0]; Replace "user" and "password" with your login and your application password. List the contents of a folder : path = "/path/onFew readersUsing the Leviia Drive API - Java/Android
Initialization : To manipulate your Leviia files from within a Java program, you first need to import the sardine library. Here's how to do it : Java : For Java, simply add these lines to your pom.xml : <dependency> <groupId>com.github.lookfirst</groupId> <artifactId>sardine</artifactId> <version>5.10</version> </dependency> Android : For Android, simply open your Gradle file (application) and add : <dependency> <groupId>com.Few readers