alexandreelise / plg_system_elodie

With this system plugin you can fetch just the fields you need from the Joomla! 4 Web Services rather than fetching everything at once. Example for articles: fetch just the id,title,featured.

Home Page:https://apiadept.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

System - Elodie

Add sparse fieldset as JSONAPI v1.0 Specs shows it to Joomla! 4 using only one system plugin


USAGE

English:

  1. Go to the build folder of this repository
  2. Download and install the latest version of the plugin on your Joomla! 4 website (make a backup first just in case)
  3. Create a Joomla Api Token from the admin of your Joomla! 4 website
  4. Make GET request call to any Joomla! 4 Web Services GET endpoint using any HTTP Client it should work. For example (Curl, Postman, Guzzle, Joomla! Http Client, etc...) with an additional query string.
  5. Enjoy. Give your feedback on potential improvement and issues

For users endpoint:

Users Collection:


curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/users?fields[users]=id,name"

Single User (id:1234)

curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/users/1234?fields[users]=id,name"

For articles endpoint:

Article Collection


curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/content/articles?fields[articles]=id,title,alias,featured,state,access"

Single Article (id:5678)

curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/content/articles/5678?fields[articles]=id,title,alias,featured,state,access"

Français:

  1. Aller dans le dossier build de ce dépot
  2. Téléchargez et installer la derniere version de ce plugin sur votre site Joomla! 4 (faite une sauvegarde avant juste au cas où
  3. Créez un Jeton Api Joomla dans la partie admin de Joomla! 4
  4. Appelez avec une requete HTTP GET n'importe quel point d'entrée des Web Services Joomla! 4 en utilisant n'importe quel client HTTP de votre choix. Par exemple (Curl, Postman, Guzzle, Joomla! Http Client, etc...) avec un paramètre en plus dans l'url
  5. Donnez vos impressions, retours sur l'utilisation, amelioration potientielle et éventuelles erreurs.

Pour le point d'entrée des utilisateurs:

Liste utilisateurs:


curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/users?fields[users]=id,name"

Un seul utilisateur (id:1234)

curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/users/1234?fields[users]=id,name"

Pour le point d'entrée des articles

Liste d'articles


curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/content/articles?fields[articles]=id,title,alias,featured,state,access"

Un seul article (id:5678)

curl -X GET -H "X-Joomla-Token: YOUR-TOKEN" -H "Accept: application/vnd.api+json; charset=utf-8" -H "Content-Type: application/vnd.api+json; charset=utf-8" --url "https://example.org/api/index.php/v1/content/articles/5678?fields[articles]=id,title,alias,featured,state,access"

JSON-API SPEC

Official specification on how sparse fieldsets should work

INFOS

English: Click here to get in touch

Français: Cliquez ici pour me contacter

About

With this system plugin you can fetch just the fields you need from the Joomla! 4 Web Services rather than fetching everything at once. Example for articles: fetch just the id,title,featured.

https://apiadept.com

License:GNU General Public License v2.0


Languages

Language:PHP 88.3%Language:Makefile 11.4%Language:HTML 0.3%