https://github.com/c-lodder/japi
A mini Joomla API wrapper
https://github.com/c-lodder/japi
api javascript joomla
Last synced: 8 months ago
JSON representation
A mini Joomla API wrapper
- Host: GitHub
- URL: https://github.com/c-lodder/japi
- Owner: C-Lodder
- License: mit
- Created: 2020-08-21T12:28:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-26T18:57:28.000Z (almost 6 years ago)
- Last Synced: 2025-01-29T07:30:07.198Z (over 1 year ago)
- Topics: api, javascript, joomla
- Language: HTML
- Homepage: https://japi.joomjunk.co.uk
- Size: 9.77 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JAPI
A mini Joomla API wrapper.
## Usage
### Including it in your page:
```javascript
```
### Importing it in your Javascript file:
```javascript
import JAPI from './japi.js'
```
### Instantiate the class:
```javascript
const japi = new JAPI(
'https://yoursite.com',
'YOUR_JOOMLA_TOKEN'
)
```
## Examples
### GET (list)
```javascript
japi.get('content/article')
.then(response => console.log(response))
```
### GET (single)
```javascript
japi.get('content/article/1')
.then(response => console.log(response))
```
### CREATE
```javascript
japi.post('content/article', {
alias: 'my-article',
articletext: 'My text',
catid: 2,
language: '*',
metadesc: '',
metakey: '',
title: 'My New Article'
}).then(response => console.log(response))
```
### DELETE
```javascript
japi.delete('content/article/1')
.then(response => console.log(response))
```
### UPDATE
```javascript
japi.update('content/article/1', {
catid: 2,
title: 'My Updated Article',
}).then(response => console.log(response))
```
## More info
Check out more [infomation on Joomla's core APIs](https://docs.joomla.org/J4.x:Joomla_Core_APIs).