"library-based" APIs
Software framework like Joomla
```php
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
echo HtmlHelper::date(
'now',
Text::_('DATE_FORMAT_LC6')
);
```
"network-based" APIs
External websites
- Map (Google/OpenStreetmap)
- Payment gateways
- CAPTCHA
"network-based" API Protocols
- Simple Object Access Protocol (SOAP)
- Representational state transfer (REST)
----
### REST
Get List of Articles
curl -X GET /api/index.php/v1/content/articles
Get Single Article
curl -X GET /api/index.php/v1/content/articles/{article_id}
Delete Article
curl -X DELETE /api/index.php/v1/content/articles/{article_id}
Create Article
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/content/articles -d
```json
{
"alias": "my-article",
"articletext": "My text",
"catid": 64,
"language": "*",
"metadesc": "",
"metakey": "",
"title": "Here's an article"
}
```
Update Article
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/content/articles/{article_id} -d
```json
{
"id": 64,
"title": "Updated article"
}
```
----
### Get List of Articles
```bash
$ curl https://example.com/api/index.php/v1/content/articles
-H "Authorization: Bearer
c2hhMjU2OjgxNjo2NTg1YWIwMTY0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
```