moodle-external-api-development
Build Moodle External Web Services
Create secure custom web service APIs for Moodle LMS with proper parameter validation, capability checks, and service registration patterns.
Baixar o ZIP da skill
Upload no Claude
Vá em Configurações → Capacidades → Skills → Upload skill
Ative e comece a usar
Testar
A utilizar "moodle-external-api-development". Create an external API to get user course progress
Resultado esperado:
- PHP class extending external_api with execute_parameters(), execute(), and execute_returns() methods
- Parameter definitions using external_value(PARAM_INT) and external_single_structure
- Context validation using validate_context() and capability checks
- Database query using parameterized queries for SQL injection prevention
A utilizar "moodle-external-api-development". Register the web service for mobile access
Resultado esperado:
- services.php file with function definition including classname, methodname, and capabilities
- Service definition with restrictedusers and enabled flags
- Use MOODLE_OFFICIAL_MOBILE_SERVICE for mobile app integration
Auditoria de Segurança
Baixo RiscoThis is a documentation/educational skill for Moodle external API development. Static analyzer flagged 127 potential issues, but evaluation confirms all are false positives. The detected patterns are: (1) Markdown backticks for code formatting flagged as shell commands, (2) Documentation URLs to moodledev.io, (3) Benign keywords in YAML frontmatter triggering false positives. No actual security risks present.
Problemas de Baixo Risco (2)
Fatores de risco
⚡ Contém scripts (1)
⚙️ Comandos externos (79)
🌐 Acesso à rede (6)
Pontuação de qualidade
O Que Você Pode Construir
Moodle Plugin Developer
Build custom external APIs for your Moodle plugin to expose functionality to mobile apps or external systems
LMS Integration Specialist
Create web service endpoints to integrate Moodle with student information systems or CRM platforms
Mobile App Backend Developer
Develop Moodle-backed REST APIs for custom mobile applications accessing course data
Tente Estes Prompts
Show me how to create a basic external API class in Moodle with the three-method pattern
How do I define input parameters with validation for a Moodle external API? Include examples for integer, text, and boolean parameters
Write example business logic for a Moodle external API that retrieves course progress, including context validation and capability checks
How do I register a Moodle external web service? Show the services.php file structure with capabilities and AJAX access
Melhores Práticas
- Always validate parameters using validate_parameters() before processing
- Use context validation and capability checks to enforce permissions
- Use parameterized queries ($DB->get_records_sql) to prevent SQL injection
- Document all parameter types and return structures clearly
Evitar
- Skipping parameter validation - always use validate_parameters()
- Using raw SQL without parameterized queries - use $DB methods with bound parameters
- Omitting capability checks - always verify user permissions
- Returning inconsistent data structures - match execute_returns() definition exactly
Perguntas Frequentes
What is the three-method pattern for Moodle external APIs?
How do I secure my Moodle external API?
Can I use my external API with the Moodle mobile app?
What parameter types does Moodle support?
How do I prevent SQL injection in external APIs?
What is the difference between read and write service types?
Detalhes do Desenvolvedor
Autor
sickn33Licença
MIT
Repositório
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/moodle-external-api-developmentReferência
main
Estrutura de arquivos
📄 SKILL.md