Skip to content

Enable Schema.org Plugin Execution for API-saved Content in Joomla CMS. #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions docs/webservices/schemaorg-api-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@

---
id: schemaorg-api-support
title: Schema.org Plugin API Documentation
description: Guide for using the Schema.org plugin via Joomla REST API
slug: /webservices/schemaorg-api-support
---


# Schema.org Plugin API Documentation

## Introduction
This document provides details about the Schema.org system plugin's API support in Joomla CMS. This guide outlines the API endpoints, payload structure, and testing instructions.


### POST /content
Creates a new content item with Schema.org metadata.

#### Request Payload:
```json
{
"title" : "Test Article",
"@type" : "Article",
"articletext" : "Content",
"author": {
"type" : "Person",
"name" : "John-doe",
"email" : "[email protected]"
}
}
```

**Response**
- Status Code: `201 Created`.
- Payload:
```json
{
"id" : 123,
"status" : "success",
"message" : "Schema.org created successfully."
}
```


### PATCH `/content/{id}`
Updates an existing content item with Schema.org metadata.
```json
{
"author": {
"type" : "Person2",
"email" : "[email protected]"
}
}
```

**Response**
- Status Code: `200 OK` or `204 No Content`.


### GET /content
Retrieves content items with Schema.org metadata.

#### Query parameters:
- `type`: Filter by type (e.g., `Article`, `Person`).
- `author`: Filter by author name.


#### Example:
```http
GET /content?type=Article&author=john-doe
```

**Responses**
- Status Code :`200 OK`.
```json
{
"id" : 123,
"title" : "Test Article",
"@type" : "Article",
"author" : {
"type" : "Person",
"name" :"John-doe",
"email" : "[email protected]"
}
}
```


#### Testing Instructions
1. Enable the Schema.org plugin in Joomla's backend.
2. Use Joomla REST API to
- **POST** : Creates new content.
- **PATCH**: Update existing content.
- **GET** : Verify structured metadata is included in the response.
3. Ensure that schema metadata appears in both API and administrator use cases.

## Results

### Actual Result Before PR
-Schema.org plugin does not execute when content is saved via API.

### Expected Result After PR
-Schema.org plugin supports execution via both admin and API clients, enabling full metadata injection.