top of page
If you are a port operator or a logistics company who wants to optimise the way you operate and move cargo and containers faster using multi-sensor data, please contact us describing your needs.
LLcloud's Public API
LLcloud’s public API is available at https://api.llcloud.eu/. It’s a RESTful API and provides basic functionalities – login, listing files and instructions and uploading data. All request and response bodies are JSON formatted. For more specific information please look at the example source code provided.
Available at
/login
Request type
POST
Request body (JSON)
{
"email": "A valid email specifying the user who logs in",
"password": "The corresponding password (since the communication is over https this is secure)"
}
Request body (on success)
{
"userInfo": "An object containing information about the user - email, name, surname, etc.",
"token": "A token used for authentication valid for 30 minutes"
}
Example code
let {userInfo, token} = await fetch("https://api.llcloud.eu/login", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email, password})
}).then(res => res.json());
Login
Example code
let {trials} = await fetch(`https://api.llcloud.eu/listtrials/${token}`).then(res => res.json())
List Trials
/listtrials/:token
Available at
GET
Request type
{
"trials": "An array of trials (containing names used for other operations)"
}
Request body (on success)
List files
/listfiles/:token/:trial_name
Available at
GET
Request type
{
"files": "An array of file metadatas"
}
Request body (on success)
let {files} = await fetch(`https://api.llcloud.eu/listfiles/${token}/${trialName}`).then(res => res.json())
Example code
Example code
let {instructions} = await fetch(`https://api.llcloud.eu/listinstructions/${token}/${trialName}`).then(res => res.json())
List instructions
/listinstructions/:token/:trial_name
Available at
GET
Request type
{
"instructions": "An array of instructions containing names and download links"
}
Request body (on success)
Available at
/upload
Request type
POST
Request body (JSON)
{
"token": "An authentication token from login",
"trial_name": "Trial name for which to upload file",
"sensor": "A string describing the sensor used to acquire the file (ex. Camera)",
"file": "The file content encoded in base64",
"extension": "The file extension (ex. jpg)"
}
Request body (on success)
{
"user": "test@example.com",
"sensor": "Phonecamera",
"filename": "demo-trial-TesTes 2021-6-23 3-5-59.jpg",
"modified": "Wed, 23 Jun 2021 00:05:59 +0000",
"size": 36388, "fileid": 4720696584
}
Example code
let file = await fs.readFile(filepath);
file = file.toString('base64') //it's important to encode the file content as a base64 string
let file = await fetch("https://api.llcloud.eu/upload", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({file, extension, sensor, token, trial_name})
}).then(res => res.json())
Upload file
Example code
let response = await fetch(`https://api.llcloud.eu/download/${token}/${fileid}`).then(res => res.json())
Download file
/download/:token/:fileid
Available at
GET
Request type
{
"link": "A link from where to download a zip archive containing the file"
}
Request body (on success)
Example code
let response = await fetch("https://api.llcloud.eu/delete", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({fileid, token, trial_name})
})
Delete file
/delete
Available at
POST
Request type
{
"token": "An authentication token from login",
"fileid": "A fileid part of the file metadata of the file to be deleted"
}
Request body (on success)
bottom of page