REST API Kit 1.3

XF 2.2 / 2.3 REST API Kit 1.3

Add-on xenforo 2

Ressources et modules complémentaires pour XenForo 2

Styles xenforo 2

Styles / Thèmes et apparence pour xenforo 2

Templates xenforo 2

Codes pour modifier les templates sur xenforo 2

Section Premium

Add-on et Styles pour membre Premium
  • ⚠️ Section Premium. Réserver aux Membres Premium ⚠️
REST API Kit 1.3

XF 2.2 / 2.3 REST API Kit 1.3

Catégorie Catégorie Add-Ons
Titre du sujet Titre du sujet REST API Kit 1.3
Auteur de la discussion Auteur de la discussion laurent68
Date de début Date de début
Réponses Réponses 2
Affichages Affichages 33
Réaction Réaction 0
Dernier message par Dernier message par laurent68

laurent68

Fondateur

Staff
fondateur
Réputation: 100%
Discussions
5 124
Messages
13 448
Solutions
85
J'aime
8 180
Points
198
You can now view and track API Kit on GitHub: github.com/XFtoWP/api-kit



API Kit adds endpoints, filters and sorts to the XenForo REST API. It's free, has no options, and works with any API key you give its scopes to.

Thread prefixes​

  • GET thread-prefixes/ lists every thread prefix with its title, CSS class and label color.
  • Every prefix in an API result, including the ones in forums/{id}, gains colors: the text, background and border color its label has in your default style.
Colors are read from your default style's compiled label CSS, so edited label styles, dark styles and custom CSS classes come through as your visitors see them. Only plain color values are sent; anything that can't be read as a color is left out.

API Kit works the colors out in a background job when your default style or a prefix's CSS class changes. API requests only read the saved result, so they stay fast.

User groups​

  • GET user-groups/ lists every user group with its title, display style priority, username CSS and banner CSS class.
  • GET users/ gains user_group_id and secondary_group_ids[] filters. A user must be in every secondary group you list.

Thread sorts​

GET threads/ gains two sorts for the forum-wide thread list:
  • most_replies=1: threads active in the last 30 days by reply count, then everything else by latest activity
  • most_viewed=1: threads by view count

Setup​

In Setup → API keys, give the keys that need them these scopes:
  • apikit_thread_prefix:read for thread-prefixes/
  • apikit_user_group:read for user-groups/
Prefix colors in other results need no extra scope. The user filters use XenForo's own user:read scope and member list permissions, and the thread sorts use thread:read.

Requirements​

XenForo 2.2 or later and PHP 7.2 or later.

Source code and developer notes are on GitHub. MIT licensed.

Télécharger V1.2.1 :

Version 1.3 Thread prefix colors :
Every thread prefix in an API result now includes colors: the text, background and border color its label has in your default style. This includes the prefixes in forums/{id} and needs no extra scope.
  • Colors as visitors see them: they're read from your default style's compiled label CSS, including edited label styles, dark styles and custom CSS classes. Only plain color values are sent.
  • No slower API requests: a background job works the colors out when your default style or a prefix's CSS class changes, and API requests only read the saved result. Until it first runs, prefixes have no colors field.
  • Changed: GET thread-prefixes/ now returns {"prefixes": [...]}, like XenForo's own list endpoints. If you read the old bare list, update your code before upgrading.
To see a real-world use of thread prefixes over the API, see the enhancements made in the XFtoWP 1.7.3 plugin.

Télécharger V1.3 :
 
Contenu similaire Les plus vues Voir plus
Retour
Haut Bas