Introduction
This documentation aims to provide all the information you need to work with our API.
As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Licences
List all licences.
requires authentication
Retourne la liste de toutes les licences.
Example request:
curl --request GET \
--get "https://mlm.pimenko.com/api/licences" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://mlm.pimenko.com/api/licences"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/licences';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
[
{
"id": 1,
"product_id": 2,
"key": "ABC123",
"status": "active",
"expires_at": "2026-12-31T00:00:00.000000Z",
"licence_type_id": 1
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a licence and its first site.
requires authentication
Crée une licence et associe un premier site.
Example request:
curl --request POST \
"https://mlm.pimenko.com/api/licence/create" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"licence_type\": 1,
\"product_id\": 2,
\"url\": \"https:\\/\\/example.com\"
}"
const url = new URL(
"https://mlm.pimenko.com/api/licence/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"licence_type": 1,
"product_id": 2,
"url": "https:\/\/example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/licence/create';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'licence_type' => 1,
'product_id' => 2,
'url' => 'https://example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"licence": {
"id": 4,
"product_id": 2,
"key": "550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo",
"status": "active",
"expires_at": "2027-06-02T00:00:00.000000Z",
"licence_type_id": 1
},
"site": {
"id": 10,
"url": "https://example.com"
}
}
Example response (422):
{
"message": "The given data was invalid."
}
Example response (500):
{
"error": "Internal error message"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Add a new site to an existing licence identified by key.
requires authentication
Ajoute un site à une licence existante identifiée par sa clé.
Example request:
curl --request POST \
"https://mlm.pimenko.com/api/licences/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo/sites" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"url\": \"https:\\/\\/example.com\"
}"
const url = new URL(
"https://mlm.pimenko.com/api/licences/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo/sites"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"url": "https:\/\/example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/licences/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo/sites';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'url' => 'https://example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"site": {
"id": 11,
"licence_id": 4,
"url": "https://example.com"
}
}
Example response (422):
{
"message": "Nombre maximal de sites atteint pour cette licence."
}
Example response (500):
{
"error": "Internal error message"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show the details of a licence and its associated sites.
requires authentication
Affiche les détails d'une licence et ses sites associés.
Example request:
curl --request GET \
--get "https://mlm.pimenko.com/api/licences/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://mlm.pimenko.com/api/licences/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/licences/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"licence_id": 4,
"status": "active",
"expires_at": "2027-06-02T00:00:00.000000Z",
"licence_type": {
"id": 1,
"name": "Standard",
"max_sites": 5
},
"product": {
"id": 2,
"name": "Moodle",
"slug": "moodle"
},
"sites": [
{
"id": 10,
"url": "https://example.com"
},
{
"id": 11,
"url": "https://another-example.com"
}
]
}
Example response (404):
{
"message": "No query results for model [App\\Models\\Licence]"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Validate a licence key and attach a site.
requires authentication
Valide une clé de licence et associe un site.
- Si la licence est
pending, elle passe àactivepuis ajoute le site. - Si la licence est déjà
active, ajoute le site. - Refuse les statuts
inactiveetexpired. - Vérifie la limite
max_sitesdu type de licence.
Example request:
curl --request POST \
"https://mlm.pimenko.com/api/licences/validate/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"url\": \"https:\\/\\/example.com\"
}"
const url = new URL(
"https://mlm.pimenko.com/api/licences/validate/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"url": "https:\/\/example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/licences/validate/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'url' => 'https://example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"valid": true,
"licence_id": 4,
"key": "550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo",
"status": "active",
"expires_at": "2027-06-02T00:00:00.000000Z",
"licence_type": {
"id": 1,
"name": "Standard",
"max_sites": 5
},
"product": {
"id": 2,
"name": "Moodle",
"slug": "moodle"
},
"sites": [
{
"id": 10,
"url": "https://example.com"
},
{
"id": 11,
"url": "https://another-example.com"
}
]
}
Example response (404):
{
"valid": false,
"message": "Licence not found"
}
Example response (422):
{
"valid": false,
"status": "inactive",
"message": "Licence is not usable"
}
Example response (422):
{
"valid": false,
"status": "expired",
"message": "Licence expired"
}
Example response (422):
{
"valid": false,
"status": "active",
"message": "Nombre maximal de sites atteint pour cette licence."
}
Example response (500):
{
"valid": false,
"message": "Internal server error",
"error": "Exception message"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get licence status and related details.
requires authentication
Retourne les informations d'une licence : statut, expiration, type, produit et sites existants.
Example request:
curl --request GET \
--get "https://mlm.pimenko.com/api/licences/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo/status" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://mlm.pimenko.com/api/licences/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo/status"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/licences/550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo/status';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"licence_id": 4,
"key": "550E8400-E29B-41D4-A716-446655440000-2Q7x9VxvR3m9y5m1n8W4k1qQ9aXhY2Z0mJfP8cT1eUo",
"status": "active",
"expires_at": "2027-06-02T00:00:00.000000Z",
"licence_type": {
"id": 1,
"name": "Standard",
"max_sites": 5
},
"product": {
"id": 2,
"name": "Moodle",
"slug": "moodle"
},
"sites": [
{
"id": 10,
"url": "https://example.com"
},
{
"id": 11,
"url": "https://another-example.com"
}
]
}
Example response (404):
{
"message": "Licence not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
LicencesTypes
List all licence types
requires authentication
Retourne la liste de tous les types de licences.
Example request:
curl --request GET \
--get "https://mlm.pimenko.com/api/licencestypes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://mlm.pimenko.com/api/licencestypes"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/licencestypes';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
[
{
"id": 1,
"name": "Standard",
"max_sites": 5,
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Products
List all products
requires authentication
Retourne la liste de tous les produits.
Example request:
curl --request GET \
--get "https://mlm.pimenko.com/api/products" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://mlm.pimenko.com/api/products"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://mlm.pimenko.com/api/products';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
[
{
"id": 1,
"name": "Plugin Moodle 1",
"slug": "plugin-moodle-1",
"description": "Description du plugin Moodle 1",
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.