YesWiki API

Utilisateurs

LIST Utilisateurs

GET https://yeswiki.net/?api/users

GET USER

GET https://yeswiki.net/?api/users/{userId}

CREATE USER

POST https://yeswiki.net/?api/users

name=…&email=…

Supprimer USER

POST https://yeswiki.net/?api/users/{userId}/delete

Groupes

LIST Groupes

GET https://yeswiki.net/?api/groups

GET GROUP

GET https://yeswiki.net/?api/groups/{group_name}

CREATE GROUP

POST https://yeswiki.net/?api/groups

name=…&users[0]=…&users[1]

Supprimer GROUP

POST https://yeswiki.net/?api/groups/{group_name}/delete

UPDATE GROUP

POST https://yeswiki.net/?api/groups/{group_name}/update

users[0]=…&users[1]

Pages

GET https://yeswiki.net/?api/pages
Get all pages

GET https://yeswiki.net/?api/pages/{pageTag}
Get indicated page's informations, with raw and html contents

GET https://yeswiki.net/?api/pages/{pageTag}/comments
Get indicated page's comments

POST https://yeswiki.net/?api/pages/{pageTag}
Save body content into indicated page (requires write access), params: body=…

POST https://yeswiki.net/?api/pages/{pageTag}/duplicate
Duplicate an external page into this YesWiki pageTag

Commentaires

GET https://yeswiki.net/?api/comments

Triples

GET https://yeswiki.net/?api/triples/{resource}&property=http%3A%2F%2Foutils-reseaux.org%2F_vocabulary%2Ftype&user=username

Sauvegardes

Seulement pour les administrateurs

GET https://yeswiki.net/?api/archives

GET https://yeswiki.net/?api/archives/{id}

POST https://yeswiki.net/?api/archives

POST https://yeswiki.net/?api/archives/{id}

Attach

GET https://yeswiki.net/?api/images/{filename}/cache/{width}/{height}/{mode}&csrftoken=xxxx
Fournit l'url du fichier de cache pour l'image voulue
Nécessite le passage du jeton anti-csrf !

Bazar

GET https://yeswiki.net/?api/forms
Retourne la liste de tous les formulaires Bazar.

GET https://yeswiki.net/?api/forms/{formId}
Retourne les informations sur le formulaire formId.

GET https://yeswiki.net/?{pageTag}
Si le header Accept est application/json, retourne la fiche au format JSON.
Si le header Accept est application/ld+json, retourne la fiche au format JSON-LD.

PUT https://yeswiki.net/?{pageTag}
Si le header Content-Type est application/json, modifie la fiche selon le JSON fourni.
Si le header Content-Type est application/ld+json, modifie la fiche selon le JSON-LD fourni.

DELETE https://yeswiki.net/?{pageTag}
Supprime la fiche Bazar.

GET https://yeswiki.net/?api/entries
Obtenir la liste des fiches de tous les formulaires Bazar.
Si le header Accept est application/ld+json, le JSON retourné sera au format sémantique (container LDP)

GET https://yeswiki.net/?api/forms/{formId}/entries
Obtenir la liste de toutes les fiches du formulaire formId
Si le header Accept est application/ld+json, le JSON retourné sera au format sémantique (container LDP)

GET https://yeswiki.net/?api/forms/{formId}/entries/json-ld
Obtenir la liste de toutes les fiches du formulaire formId au format sémantique (container LDP)

GET https://yeswiki.net/?api/forms/{formId}/entries/html
Obtenir la liste de toutes les fiches du formulaire formId au format json, avec la représentation html de la fiche dans le champ html_output

GET https://yeswiki.net/?api/forms/{formId}/entries/geojson
Obtenir la liste de toutes les fiches du formulaire formId au format geojson

GET https://yeswiki.net/?api/forms/{formId}/entries/ical
Obtenir la liste de toutes les fiches du formulaire formId au format ical
Il est possible de filtrer sur les dates en ajoutant à l'url &datefilter=>-6M (exemple pour les dates plus récentes que 6 mois)

GET https://yeswiki.net/?api/forms/{formId}/entries&fields=bf_titre
Obtenir la liste de toutes les fiches du formulaire formId en ne gardant que les titres (il est possible de spécifier d\autres champs en séparant leur nom par des ',')

POST https://yeswiki.net/?api/entries/{formId}
Créer une nouvelle fiche en utilisant le formulaire formId
Si le header Content-Type est application/ld+json, un JSON sémantique est attendu.

GET https://yeswiki.net/?api/entries/html
Obtenir la liste de toutes les fiches au format json, avec la représentation html de la fiche dans le champ html_output

GET https://yeswiki.net/?api/entries/bazarlist
Obtenir les données nécessaires à bazarliste dynamic au format json

POST https://yeswiki.net/?api/entries/{formId}/json-ld
Créer une nouvelle fiche de type formId au format sémantique

GET https://yeswiki.net/?api/entries/geojson
Obtenir la liste de toutes les fiches au format geojson

GET https://yeswiki.net/?api/entries/ical
Obtenir la liste de toutes les fiches au format ical

GET https://yeswiki.net/?api/entries/{output}&fields=bf_titre
Obtenir la liste de toutes les fiches au format spécifié en ne gardant que les titres (il est possible de spécifier d'autres champs en séparant leur nom par des ',' ex: &field=bf_titre,url)

GET https://yeswiki.net/?api/entry/url/{sourceUrl}
Retourne l'URL de la page Wiki synchronisée avec sourceUrl

Extension Ferme

POST https://yeswiki.net/?api/ferme/wikis DataTables server-side data for the wikis admin table (admins only).
Params: draw, start, length, search[value], order[0][column], order[0][dir]

POST https://yeswiki.net/?api/ferme/wikis/search Scan the server for wikis not yet in the farm bazar and import them (admins only).
Params: csrf-token
Returns: wikisInBazar, wikisOnServer, results[], imported[]

POST https://yeswiki.net/?api/ferme/wikis/upgrade Upgrade a single wiki to the state of the farm master (admins only).
Params: folder (folder name), csrf-token

POST https://yeswiki.net/?api/ferme/wikis/delete Delete a wiki — removes folder, DB tables and bazar entry (admins only).
Params: id_fiche (page tag), csrf-token

POST https://yeswiki.net/?api/ferme/wikis/admin-add Create or refresh the farm super-admin account on a wiki, and add it to its @admins group. Run on a wiki that already has the account, it resets the password from the farm config (admins only).
Params: folder (folder name), csrf-token

POST https://yeswiki.net/?api/ferme/wikis/admin-remove Delete the farm super-admin account from a wiki and drop it from its @admins group (admins only).
Params: folder (folder name), csrf-token

POST https://yeswiki.net/?api/ferme/models/assets Walk the fetch of a wiki model's files and custom folders one step further. The generate-model screen starts the fetch and its javascript polls this until it stops running (admins only).
Params: action (status or cancel), csrf-token
Returns: running, step, bytes, total, messages[], error

Extension Hello World

The following code :
GET https://yeswiki.net/?api/hello/{test}
gives :
test
Example :
GET https://yeswiki.net/?api/hello/test

Extension LMS

The following codes give quiz's results:
GET https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId}/{moduleId}/{activityId}/{quizId} for a quiz
GET https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId}/{moduleId}/{activityId} for all quizzes of an activity
GET https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId}/{moduleId} for all quizzes of all activities of a module
GET https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId} for all quizzes of all modules of a course
GET https://yeswiki.net/?api/lms/users/{userId}/quizresults for all quizzes for the user

All routes can be used without '/users/{userId}/' to get all quizzes for all users
if connected as admin (otherwise current user)
. Example:
GET https://yeswiki.net/?api/lms/quizresults/{courseId}/{moduleId}/{activityId} for all quizzes of an activity for all users

Results in json
Error:
["status":1,"message":"error message if needed"]
Success:
["status":0,"results":[{...},{...},
{"learner":"userId","course":"courseId","module":"moduleId","activity":"activityId",
"quizId":"quizId","log_time":"2021-01-01 01:23:22","result":"32"}]]// value in percent

No results:
["status":2]
You must sent cookies to be connected as learner or admin.

GET https://yeswiki.net/?api/lms/quizresults/{courseId}/{moduleId}/{activityId}/{quizId}
Same as previous but for current connected learner

The following code :
POST https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId}/{moduleId}/{activityId}/{quizId}
saves data float value sent in $_POST['result'] for the specified user
Return:
["status":0 = OK/1 = error,
"message":"error message"]

You must sent cookies to be connected as learner or admin.

POST https://yeswiki.net/?api/lms/quizresults/{courseId}/{moduleId}/{activityId}/{quizId}
Same as previous but for current connected learner

The following codes delete quiz's results:
DELETE https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId}/{moduleId}/{activityId}/{quizId} for a quiz
DELETE https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId}/{moduleId}/{activityId} for all quizzes of an activity
DELETE https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId}/{moduleId} for all quizzes of a module
DELETE https://yeswiki.net/?api/lms/users/{userId}/quizresults/{courseId} for all quizzes of a course
DELETE https://yeswiki.net/?api/lms/users/{userId}/quizresults for all quizzes of a user
DELETE https://yeswiki.net/?api/lms/quizresults for all quizzes of all user
You must sent cookies to be connected as admin.

The following code :
GET https://yeswiki.net/?api/lms/activity-navigation-conditions/{courseId}/{moduleId}/{activityId}
gives for {activity} of {module} of {course} for the current user :
[code:HTML_CODE,
conditionsMet:true/false,
errorStatus:true/false",
reactionsNeeded:true/false,
(optionnal) url:"https://...",
messages:[...],
formattedMessages:"<.....>"]

Extension Login

GET https://yeswiki.net/?api/auth Get all users (admin only)

GET https://yeswiki.net/?api/auth/{user} Get indicated user (admin only)

GET https://yeswiki.net/?api/auth/me Get basic info (username, isAdmin) for connected user (needs authenticated user)

POST https://yeswiki.net/?api/auth/login login user with param user and password

POST https://yeswiki.net/?api/auth/logout logout current connected user

Extension Qrcode

GET https://yeswiki.net/?api/relations/{type}
Retourne la liste de toutes les relations (dont on peut préciser le type ou laisser vide).

POST https://yeswiki.net/?api/relations
Ajoute une fiche de type relation dans la base de données.

Extension Templates

POST https://yeswiki.net/?api/templates/custom-presets/{presetFilename}
Sauvegarde un fichier preset personnalisé.

DELETE https://yeswiki.net/?api/templates/custom-presets/{presetFilename}
Supprime un fichier preset personnalisé.