J4.x

Difference between revisions of "Joomla Core APIs"

From Joomla! Documentation

(Marked this version for translation)
m
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
<translate><!--T:1--> This page lists the endpoints available in Joomla by example of curl commands.</translate>
 
<translate><!--T:1--> This page lists the endpoints available in Joomla by example of curl commands.</translate>
  
<translate><!--T:2--> Every URL requires authentication unless designated a public URL. For security in Joomla 4.0.0 we plan to make the default Api Application require a Super User account (as the API Application is brand new), this may get relaxed as the API stabilizes and is well tested in the community. If you are using the basic authentication plugin (currently the only shipped plugin as of Joomla 4 alpha 10) it requires the addition to the curl commands below using --user user_name:password</translate>
+
<translate><!--T:2--> Every URL requires authentication unless designated a public URL. For security in Joomla 4.0.0 we plan to make the default API Application require a Super User account (as the API Application is brand new), this may get relaxed as the API stabilizes and is well tested in the community.
  
<translate><!--T:3--> Every URL needs to be prepended with the Joomla host before the path (e.g. instead of <tt>/api/index.php/v1/article</tt> you need <tt><nowiki>http://example.com/api/index.php/v1/article</nowiki></tt>)</translate>
+
If you are using the basic authentication plugin ("API Authentication - Web Services Basic Auth") it requires the addition to the curl commands below using ''--user user_name:password''.
 +
 
 +
If you want to use the more secure token authentication (Bearer authentication) with activated plugins "API Authentication - Web Services Joomla Token" and "User - Joomla API Token" see the opener post on https://github.com/joomla/joomla-cms/pull/27021 for examples how to add it to your curl commands.</translate>
 +
 
 +
<translate><!--T:3--> Every URL needs to be prepended with the Joomla host before the path (e.g. instead of ''/api/index.php/v1/article'' you need ''<nowiki>https://example.com/api/index.php/v1/article</nowiki>'')</translate>
  
 
<translate><!--T:4--> Any names of properties in curly brackets ({}) indicate the property is a variable that should be substituted.</translate>
 
<translate><!--T:4--> Any names of properties in curly brackets ({}) indicate the property is a variable that should be substituted.</translate>
  
<translate><!--T:5--> Unless otherwise noted these APIs were introduced in Joomla 4. For more information on the Joomla API Specification (as opposed to this list of URLs and options) please visit the [[S:MyLanguage/Joomla Api Specification|Joomla Api Specification]].</translate>
+
<translate><!--T:5--> Unless otherwise noted these APIs were introduced in Joomla 4. For more information on the Joomla API Specification (as opposed to this list of URLs and options) please visit the [[S:MyLanguage/Joomla Api Specification|Joomla API Specification]].</translate>
  
 
<translate>
 
<translate>
 
<!--T:200-->
 
<!--T:200-->
Where end points require the value of {app} the variable currently takes two values, site (front end), or administrator {back end)
+
Where end points require the value of ''{app}'' the variable currently takes two values, site (Frontend), or Administrator (Backend).
 
</translate>
 
</translate>
 
  
 
==<translate><!--T:201--> Useful Resources</translate>==
 
==<translate><!--T:201--> Useful Resources</translate>==
<translate><!--T:202--> A number of complimentary resources have been created to introduce Joomla Web Services and assist you with learning how to implement Web Services on your project.</translate>
+
<translate><!--T:202--> A number of complimentary resources have been created to introduce Joomla Web services and assist you with learning how to implement Web services on your project.</translate>
* [https://github.com/alexandreelise/j4x-api-collection <translate><!--T:203--> Postman collection of Joomla Web Services API calls by Alexandre Elise</translate>]
+
* [https://github.com/alexandreelise/j4x-api-collection <translate><!--T:203--> Postman collection of Joomla Web services API calls by Alexandre Elise</translate>]
* [https://www.youtube.com/watch?v=lT9qodsvfZg <translate><!--T:204--> Youtube: Joomla 4 tutorial: Using the Web Services API with Eoin Oliver</translate>]
+
* [https://www.youtube.com/watch?v=lT9qodsvfZg <translate><!--T:204--> Youtube: Joomla 4 tutorial: Using the Web services API with Eoin Oliver</translate>]
* [https://magazine.joomla.org/all-issues/august-2020/joomla-web-services-api-101-tokens,-testing-and-a-taste-test <translate><!--T:205--> Joomla Community Magazine: Joomla Web Services API 101 by Patrick Jackson</translate>]
+
* [https://magazine.joomla.org/all-issues/august-2020/joomla-web-services-api-101-tokens,-testing-and-a-taste-test <translate><!--T:205--> Joomla Community Magazine: Joomla Web services API 101 by Patrick Jackson</translate>]
 
 
  
 
<translate>
 
<translate>
Line 45: Line 47:
 
==== Create Banner ==== <!--T:11-->
 
==== Create Banner ==== <!--T:11-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "catid": 3,
 
     "catid": 3,
Line 61: Line 63:
 
     }
 
     }
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Banner ==== <!--T:12-->
 
==== Update Banner ==== <!--T:12-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/{banner_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/{banner_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "alias": "name",
 
     "alias": "name",
Line 74: Line 76:
 
     "name": "New Name"
 
     "name": "New Name"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 82: Line 84:
 
==== Get List of Clients ==== <!--T:14-->
 
==== Get List of Clients ==== <!--T:14-->
 
</translate>
 
</translate>
curl -X GET /api/index.php/v1/banners/clients  
+
curl -X GET /api/index.php/v1/banners/clients
  
 
<translate>
 
<translate>
Line 97: Line 99:
 
==== Create Client ==== <!--T:17-->
 
==== Create Client ==== <!--T:17-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners/clients -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners/clients -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "contact": "Name",
 
     "contact": "Name",
Line 107: Line 109:
 
     "state": 1
 
     "state": 1
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Client ==== <!--T:18-->
 
==== Update Client ==== <!--T:18-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/clients/{client_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/clients/{client_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "contact": "new Name",
 
     "contact": "new Name",
Line 119: Line 121:
 
     "name": "Clients"
 
     "name": "Clients"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 127: Line 129:
 
==== Get List of Categories ==== <!--T:20-->
 
==== Get List of Categories ==== <!--T:20-->
 
</translate>
 
</translate>
curl -X GET /api/index.php/v1/banners/categories  
+
curl -X GET /api/index.php/v1/banners/categories
  
 
<translate>
 
<translate>
Line 142: Line 144:
 
==== Create Category ==== <!--T:23-->
 
==== Create Category ==== <!--T:23-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners/categories -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners/categories -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": 1,
 
     "access": 1,
Line 154: Line 156:
 
     "title": "Title"
 
     "title": "Title"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
 
==== Update Category ==== <!--T:24-->
 
==== Update Category ==== <!--T:24-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/categories/{category_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/categories/{category_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "alias": "cat",
 
     "alias": "cat",
Line 168: Line 169:
 
     "title": "New Title"
 
     "title": "New Title"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 202: Line 203:
 
==== Update Application Config ==== <!--T:32-->
 
==== Update Application Config ==== <!--T:32-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/config/application -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/config/application -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "debug": true,
 
     "debug": true,
 
     "sitename": "123"
 
     "sitename": "123"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 223: Line 224:
 
==== Update Application Config ==== <!--T:35-->
 
==== Update Application Config ==== <!--T:35-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/config/application -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/config/application -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "link_titles": 1
 
     "link_titles": 1
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 254: Line 255:
 
==== Create Contact ==== <!--T:41-->
 
==== Create Contact ==== <!--T:41-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/contact -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/contact -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "alias": "contact",
 
     "alias": "contact",
Line 262: Line 263:
 
     "name": "Contact"
 
     "name": "Contact"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Contact ==== <!--T:42-->
 
==== Update Contact ==== <!--T:42-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/contact/{contact_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/contact/{contact_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "alias": "contact",
 
     "alias": "contact",
Line 274: Line 275:
 
     "name": "New Contact"
 
     "name": "New Contact"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Submit Contact Form ==== <!--T:43-->
 
==== Submit Contact Form ==== <!--T:43-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/contact/form/{contact_id} -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/contact/form/{contact_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "contact_email": "email@mail.com",
 
     "contact_email": "email@mail.com",
Line 287: Line 288:
 
     "contact_subject": "subject"
 
     "contact_subject": "subject"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 316: Line 317:
 
==== Create Field Contact ==== <!--T:51-->
 
==== Create Field Contact ==== <!--T:51-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/fields/contact/contact -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/fields/contact/contact -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": 1,
 
     "access": 1,
Line 347: Line 348:
 
     "type": "text"
 
     "type": "text"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Field Contact ==== <!--T:52-->
 
==== Update Field Contact ==== <!--T:52-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/fields/contact/contact/{field_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/fields/contact/contact/{field_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "title": "new contact field",
 
     "title": "new contact field",
Line 363: Line 364:
 
     "description": "Some New Text"
 
     "description": "Some New Text"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 398: Line 399:
 
==== Create Group Fields Contact ==== <!--T:63-->
 
==== Create Group Fields Contact ==== <!--T:63-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/fields/groups/contact/contact -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/fields/groups/contact/contact -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": 1,
 
     "access": 1,
Line 429: Line 430:
 
     "type": "text"
 
     "type": "text"
 
}
 
}
</source>
+
</syntaxhighlight>
 
<translate>
 
<translate>
 
==== Update Group Fields Contact ==== <!--T:64-->
 
==== Update Group Fields Contact ==== <!--T:64-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/fields/groups/contact/contact/{group_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/fields/groups/contact/contact/{group_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "title": "new contact group",
 
     "title": "new contact group",
Line 440: Line 441:
 
     "description": "new description"
 
     "description": "new description"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 472: Line 473:
  
 
<translate>
 
<translate>
 
 
==== Get Single Article ==== <!--T:77-->
 
==== Get Single Article ==== <!--T:77-->
 
</translate>
 
</translate>
Line 485: Line 485:
 
==== Create Article ==== <!--T:79-->
 
==== Create Article ==== <!--T:79-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/content/articles -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/content/articles -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "alias": "my-article",
 
     "alias": "my-article",
Line 496: Line 496:
 
     "title": "Here's an article"
 
     "title": "Here's an article"
 
}
 
}
</source>
+
</syntaxhighlight>
  
<translate><!--T:80--> Currently the options mentioned here are required properties. However the intention is currently to make AT LEAST metakey and metadesc optional in the API.</translate>
+
<translate><!--T:80--> Currently the options mentioned here are required properties. However the intention is currently to make '''at least''' ''metakey'' and ''metadesc'' optional in the API.</translate>
  
 
<translate>
 
<translate>
 
==== Update Article ==== <!--T:81-->
 
==== Update Article ==== <!--T:81-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/content/articles/{article_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/content/articles/{article_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "catid": 64,
 
     "catid": 64,
 
     "title": "Updated article"
 
     "title": "Updated article"
 
}
 
}
</source>
+
</syntaxhighlight>
 
 
  
 
<translate>
 
<translate>
Line 516: Line 515:
 
</translate>
 
</translate>
 
#Route Content Categories is: "v1/content/categories"
 
#Route Content Categories is: "v1/content/categories"
#Working with it is similar to [[S:MyLanguage/#Categories|Banners Categories]], note if workflows is enabled then specifying a workflow is required (similarly to the UI)
+
#Working with it is similar to [[S:MyLanguage/#Categories|Banners Categories]], note if workflows is enabled then specifying a workflow is required (similarly to the UI).
  
 
<translate>
 
<translate>
Line 557: Line 556:
 
==== Install Language ==== <!--T:98-->
 
==== Install Language ==== <!--T:98-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "package": "pkg_fr-FR"
 
     "package": "pkg_fr-FR"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 585: Line 584:
 
==== Create Content Language ==== <!--T:103-->
 
==== Create Content Language ==== <!--T:103-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/content -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/content -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": 1,
 
     "access": 1,
Line 601: Line 600:
 
     "title_native": "Français (France)"
 
     "title_native": "Français (France)"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Content Language ==== <!--T:104-->
 
==== Update Content Language ==== <!--T:104-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/languages/content/{language_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/languages/content/{language_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "description": "",
 
     "description": "",
Line 617: Line 616:
 
     "title_native": "English (United Kingdom)"
 
     "title_native": "English (United Kingdom)"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 640: Line 639:
 
==== Create Content Language ==== <!--T:109-->
 
==== Create Content Language ==== <!--T:109-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/{app}/{lang_code} -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/{app}/{lang_code} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "key":"new_key",
 
     "key":"new_key",
 
     "override": "text"
 
     "override": "text"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Content Language ==== <!--T:110-->
 
==== Update Content Language ==== <!--T:110-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/{app}/{lang_code}/{constant_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/{app}/{lang_code}/{constant_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "key":"new_key",
 
     "key":"new_key",
 
     "override": "new text"
 
     "override": "new text"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
var app - enum {"site", "administrator"}
 
var app - enum {"site", "administrator"}
Line 666: Line 665:
 
==== Search Override Constant ==== <!--T:111-->
 
==== Search Override Constant ==== <!--T:111-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/search -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/search -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "searchstring": "JLIB_APPLICATION_ERROR_SAVE_FAILED",
 
     "searchstring": "JLIB_APPLICATION_ERROR_SAVE_FAILED",
 
     "searchtype": "constant"
 
     "searchtype": "constant"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate><!--T:112--> var searchtype - enum {“constant”, “value”}. “constant” search by constant name, “value” - search by constant value</translate>
 
<translate><!--T:112--> var searchtype - enum {“constant”, “value”}. “constant” search by constant name, “value” - search by constant value</translate>
Line 705: Line 704:
 
==== Create Menu ==== <!--T:119-->
 
==== Create Menu ==== <!--T:119-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/menus/{app} -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/menus/{app} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "client_id": 0,
 
     "client_id": 0,
Line 713: Line 712:
 
     "title": "Menu"
 
     "title": "Menu"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Menu ==== <!--T:120-->
 
==== Update Menu ==== <!--T:120-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/{menu_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/{menu_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "menutype": "menu",
 
     "menutype": "menu",
 
     "title": "New Menu"
 
     "title": "New Menu"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 752: Line 751:
 
==== Create Menu Item ==== <!--T:126-->
 
==== Create Menu Item ==== <!--T:126-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/items -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/items -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": "1",
 
     "access": "1",
Line 798: Line 797:
 
     "type": "component"
 
     "type": "component"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate><!--T:127--> Example for "Create Article Page"</translate>
 
<translate><!--T:127--> Example for "Create Article Page"</translate>
Line 805: Line 804:
 
==== Update Menu Item ==== <!--T:128-->
 
==== Update Menu Item ==== <!--T:128-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/items/{menu_item_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/items/{menu_item_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "component_id": "20",
 
     "component_id": "20",
Line 816: Line 815:
 
     "type": "component"
 
     "type": "component"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate><!--T:129--> Example for "Create Article Page"</translate>
 
<translate><!--T:129--> Example for "Create Article Page"</translate>
Line 844: Line 843:
 
==== Create Message ==== <!--T:135-->
 
==== Create Message ==== <!--T:135-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/messages -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/messages -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "message": "<p>text</p>",
 
     "message": "<p>text</p>",
Line 853: Line 852:
 
     "user_id_to": 772
 
     "user_id_to": 772
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Message ==== <!--T:136-->
 
==== Update Message ==== <!--T:136-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/messages/{message_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/messages/{message_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "message": "<p>new text</p>",
 
     "message": "<p>new text</p>",
Line 866: Line 865:
 
     "user_id_to": 772
 
     "user_id_to": 772
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 897: Line 896:
 
==== Create Module ==== <!--T:143-->
 
==== Create Module ==== <!--T:143-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/modules/{app} -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/modules/{app} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": "1",
 
     "access": "1",
Line 931: Line 930:
 
     "title": "Title"
 
     "title": "Title"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate><!--T:144--> Example for "Articles - Archived"</translate>
 
<translate><!--T:144--> Example for "Articles - Archived"</translate>
Line 938: Line 937:
 
==== Update Module ==== <!--T:145-->
 
==== Update Module ==== <!--T:145-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/modules/{app}/{module_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/modules/{app}/{module_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": "1",
 
     "access": "1",
Line 949: Line 948:
 
     "title": "New Title"
 
     "title": "New Title"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<noinclude>Example for "Articles - Archived"</noinclude>
 
<noinclude>Example for "Articles - Archived"</noinclude>
Line 977: Line 976:
 
==== Create Feed ==== <!--T:151-->
 
==== Create Feed ==== <!--T:151-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/newsfeeds/feeds -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/newsfeeds/feeds -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": 1,
 
     "access": 1,
Line 995: Line 994:
 
     },
 
     },
 
     "language": "*",
 
     "language": "*",
     "link": "http://samoylov/joomla/gsoc19_webservices/index.php",
+
     "link": "https://github.com/joomla-projects/gsoc19_webservices",
 
     "metadata": {
 
     "metadata": {
 
         "hits": "",
 
         "hits": "",
Line 1,019: Line 1,018:
 
     "published": 1
 
     "published": 1
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Feed ==== <!--T:152-->
 
==== Update Feed ==== <!--T:152-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/newsfeeds/feeds/{feed_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/newsfeeds/feeds/{feed_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": 1,
 
     "access": 1,
Line 1,031: Line 1,030:
 
     "catid": 5,
 
     "catid": 5,
 
     "description": "",
 
     "description": "",
     "link": "http://samoylov/joomla/gsoc19_webservices/index.php",
+
     "link": "https://github.com/joomla-projects/gsoc19_webservices",
 
     "metadesc": "",
 
     "metadesc": "",
 
     "metakey": "",
 
     "metakey": "",
 
     "name": "Test"
 
     "name": "Test"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 1,068: Line 1,067:
 
==== Create Request ==== <!--T:161-->
 
==== Create Request ==== <!--T:161-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/privacy/request -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/privacy/request -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "email":"somenewemail@com.ua",
 
     "email":"somenewemail@com.ua",
 
     "request_type":"export"
 
     "request_type":"export"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 1,118: Line 1,117:
 
==== Create Redirect ==== <!--T:171-->
 
==== Create Redirect ==== <!--T:171-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/redirect -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/redirect -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "comment": "",
 
     "comment": "",
Line 1,129: Line 1,128:
 
     "referer": ""
 
     "referer": ""
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Redirect ==== <!--T:172-->
 
==== Update Redirect ==== <!--T:172-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/redirect/{redirect_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/redirect/{redirect_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "new_url": "/content/art/4",
 
     "new_url": "/content/art/4",
 
     "old_url": "/content/art/132"
 
     "old_url": "/content/art/132"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 1,166: Line 1,165:
 
==== Create Tag ==== <!--T:178-->
 
==== Create Tag ==== <!--T:178-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/tags -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/tags -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "access": 1,
 
     "access": 1,
Line 1,180: Line 1,179:
 
     "title": "test"
 
     "title": "test"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Tag ==== <!--T:179-->
 
==== Update Tag ==== <!--T:179-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/tags/{tag_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/tags/{tag_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "alias": "test",
 
     "alias": "test",
 
     "title": "new title"
 
     "title": "new title"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 1,217: Line 1,216:
 
==== Create Template Style ==== <!--T:185-->
 
==== Create Template Style ==== <!--T:185-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/templates/styles/{app} -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/templates/styles/{app} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "home": "0",
 
     "home": "0",
Line 1,230: Line 1,229:
 
     "title": "cassiopeia - Some Text"
 
     "title": "cassiopeia - Some Text"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update Template Style ==== <!--T:186-->
 
==== Update Template Style ==== <!--T:186-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/templates/styles/{app}/{template_style_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/templates/styles/{app}/{template_style_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
"template": "cassiopeia",
 
"template": "cassiopeia",
 
"title": "new cassiopeia - Default"
 
"title": "new cassiopeia - Default"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
Line 1,267: Line 1,266:
 
==== Create User ==== <!--T:192-->
 
==== Create User ==== <!--T:192-->
 
</translate>
 
</translate>
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/users -d  
+
curl -X POST -H "Content-Type: application/json" /api/index.php/v1/users -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "block": "0",
 
     "block": "0",
Line 1,295: Line 1,294:
 
     "username": "ad"
 
     "username": "ad"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
==== Update User ==== <!--T:193-->
 
==== Update User ==== <!--T:193-->
 
</translate>
 
</translate>
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/users/{user_id} -d  
+
curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/users/{user_id} -d
<source lang="javascript">
+
<syntaxhighlight lang="javascript">
 
{
 
{
 
     "email": "new@mail.com",
 
     "email": "new@mail.com",
Line 1,310: Line 1,309:
 
     "username": "username"
 
     "username": "username"
 
}
 
}
</source>
+
</syntaxhighlight>
  
 
<translate>
 
<translate>
 
=== Fields Users === <!--T:194-->
 
=== Fields Users === <!--T:194-->
 
</translate>
 
</translate>
<translate><!--T:195--> #Route Fields Users is:</translate> "v1/fields/users"
+
<translate><!--T:195--> #Route Fields Users is:</translate> ''v1/fields/users''
 
<translate><!--T:196--> #Working with it is similar to [[S:MyLanguage/J4.x:Joomla_Core_APIs#Fields_Contact|Fields Contact]].</translate>
 
<translate><!--T:196--> #Working with it is similar to [[S:MyLanguage/J4.x:Joomla_Core_APIs#Fields_Contact|Fields Contact]].</translate>
  
 
<translate>
 
<translate>
 
 
=== Groups Fields Users === <!--T:197-->
 
=== Groups Fields Users === <!--T:197-->
 
</translate>
 
</translate>
<translate><!--T:198--> #Route Groups Fields Users is:</translate> "v1/fields/groups/users"
+
<translate><!--T:198--> #Route Groups Fields Users is:</translate> ''v1/fields/groups/users''
 
<translate><!--T:199--> #Working with it is similar to [[S:MyLanguage/J4.x:Joomla_Core_APIs#Groups_Fields_Contact|Groups Fields Contact]].</translate>
 
<translate><!--T:199--> #Working with it is similar to [[S:MyLanguage/J4.x:Joomla_Core_APIs#Groups_Fields_Contact|Groups Fields Contact]].</translate>
  

Revision as of 18:51, 21 November 2022

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français • ‎italiano
Joomla! 
4.0

This page lists the endpoints available in Joomla by example of curl commands.

Every URL requires authentication unless designated a public URL. For security in Joomla 4.0.0 we plan to make the default API Application require a Super User account (as the API Application is brand new), this may get relaxed as the API stabilizes and is well tested in the community.

If you are using the basic authentication plugin ("API Authentication - Web Services Basic Auth") it requires the addition to the curl commands below using --user user_name:password.

If you want to use the more secure token authentication (Bearer authentication) with activated plugins "API Authentication - Web Services Joomla Token" and "User - Joomla API Token" see the opener post on https://github.com/joomla/joomla-cms/pull/27021 for examples how to add it to your curl commands.

Every URL needs to be prepended with the Joomla host before the path (e.g. instead of /api/index.php/v1/article you need https://example.com/api/index.php/v1/article)

Any names of properties in curly brackets ({}) indicate the property is a variable that should be substituted.

Unless otherwise noted these APIs were introduced in Joomla 4. For more information on the Joomla API Specification (as opposed to this list of URLs and options) please visit the Joomla API Specification.

Where end points require the value of {app} the variable currently takes two values, site (Frontend), or Administrator (Backend).

Useful Resources[edit]

A number of complimentary resources have been created to introduce Joomla Web services and assist you with learning how to implement Web services on your project.

Banners[edit]

Banners[edit]

Get List of Banners[edit]

curl -X GET /api/index.php/v1/banners

Get Single Banner[edit]

curl -X GET /api/index.php/v1/banners/{banner_id}

Delete Banner[edit]

curl -X DELETE /api/index.php/v1/banners/{banner_id}

Create Banner[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners -d

{
    "catid": 3,
    "clicks": 0,
    "custombannercode": "",
    "description": "Text",
    "metakey": "",
    "name": "Name",
    "params": {
        "alt": "",
        "height": "",
        "imageurl": "",
        "width": ""
    }
}

Update Banner[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/{banner_id} -d

{
    "alias": "name",
    "catid": 3,
    "description": "New Text",
    "name": "New Name"
}

Clients[edit]

Get List of Clients[edit]

curl -X GET /api/index.php/v1/banners/clients

Get Single Client[edit]

curl -X GET /api/index.php/v1/banners/clients/{client_id}

Delete Client[edit]

curl -X DELETE /api/index.php/v1/banners/clients/{client_id}

Create Client[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners/clients -d

{
    "contact": "Name",
    "email": "email@mail.com",
    "extrainfo": "",
    "metakey": "",
    "name": "Clients",
    "state": 1
}

Update Client[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/clients/{client_id} -d

{
    "contact": "new Name",
    "email": "newemail@mail.com",
    "name": "Clients"
}

Categories[edit]

Get List of Categories[edit]

curl -X GET /api/index.php/v1/banners/categories

Get Single Category[edit]

curl -X GET /api/index.php/v1/banners/categories/{category_id}

Delete Category[edit]

curl -X DELETE /api/index.php/v1/banners/categories/{category_id}

Create Category[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/banners/categories -d

{
    "access": 1,
    "alias": "cat",
    "extension": "com_banners",
    "language": "*",
    "note": "",
    "parent_id": 1,
    "published": 1,
    "title": "Title"
}

Update Category[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/categories/{category_id} -d

{
    "alias": "cat",
    "note": "Some Text",
    "parent_id": 1,
    "title": "New Title"
}

Content History[edit]

Get List of Content Histories[edit]

curl -X GET /api/index.php/v1/banners/contenthistory/{banner_id}

Toggle Keep Content History[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/banners/contenthistory/keep/{contenthistory_id}

Delete Content History[edit]

curl -X DELETE /api/index.php/v1/banners/contenthistory/{contenthistory_id}

Config[edit]

Application[edit]

Get List of Application Configs[edit]

curl -X GET /api/index.php/v1/config/application

Update Application Config[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/config/application -d

{
    "debug": true,
    "sitename": "123"
}

Component[edit]

Get List of Component Configs[edit]

curl -X GET /api/index.php/v1/config/{component_name}

Example “component_name” is “com_content”.

Update Application Config[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/config/application -d

{
    "link_titles": 1
}

Contact[edit]

Contact[edit]

Get List of Contacts[edit]

curl -X GET /api/index.php/v1/contact

Get Single Contact[edit]

curl -X GET /api/index.php/v1/contact/{contact_id}

Delete Contact[edit]

curl -X DELETE /api/index.php/v1/contact/{contact_id}

Create Contact[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/contact -d

{
    "alias": "contact",
    "catid": 4,
    "language": "*",
    "name": "Contact"
}

Update Contact[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/contact/{contact_id} -d

{
    "alias": "contact",
    "catid": 4,
    "name": "New Contact"
}

Submit Contact Form[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/contact/form/{contact_id} -d

{
    "contact_email": "email@mail.com",
    "contact_message": "some text",
    "contact_name": "name",
    "contact_subject": "subject"
}

Categories[edit]

  1. Route Contact Categories is: "v1/contact/categories"
  2. Working with it is similar to Banners Categories.

Fields Contact[edit]

Get List of Fields Contact[edit]

curl -X GET /api/index.php/v1/fields/contact/contact

Get Single Field Contact[edit]

curl -X GET /api/index.php/v1/fields/contact/contact/{field_id}

Delete Field Contact[edit]

curl -X DELETE /api/index.php/v1/fields/contact/contact/{field_id}

Create Field Contact[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/fields/contact/contact -d

{
    "access": 1,
    "context": "com_contact.contact",
    "default_value": "",
    "description": "",
    "group_id": 0,
    "label": "contact field",
    "language": "*",
    "name": "contact-field",
    "note": "",
    "params": {
        "class": "",
        "display": "2",
        "display_readonly": "2",
        "hint": "",
        "label_class": "",
        "label_render_class": "",
        "layout": "",
        "prefix": "",
        "render_class": "",
        "show_on": "",
        "showlabel": "1",
        "suffix": ""
    },
    "required": 0,
    "state": 1,
    "title": "contact field",
    "type": "text"
}

Update Field Contact[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/fields/contact/contact/{field_id} -d

{
    "title": "new contact field",
    "name": "contact-field",
    "label": "contact field",
    "default_value": "",
    "type": "text",
    "note": "",
    "description": "Some New Text"
}

Fields Contact Mail[edit]

  1. Route Fields Contact Mail is: "v1/fields/contact/mail"
  2. Working with it is similar to Fields Contact.

Fields Contact Categories[edit]

  1. Route Fields Contact Categories is: "v1/fields/contact/categories"
  2. Working with it is similar to Fields Contact.

Groups Fields Contact[edit]

Get List of Groups Fields Contact[edit]

curl -X GET /api/index.php/v1/fields/groups/contact/contact

Get Single Group Fields Contact[edit]

curl -X GET /api/index.php/v1/fields/groups/contact/contact/{group_id}

Delete Group Fields Contact[edit]

curl -X DELETE /api/index.php/v1/fields/groups/contact/contact/{group_id}

Create Group Fields Contact[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/fields/groups/contact/contact -d

{
    "access": 1,
    "context": "com_contact.contact",
    "default_value": "",
    "description": "",
    "group_id": 0,
    "label": "contact field",
    "language": "*",
    "name": "contact-field3",
    "note": "",
    "params": {
        "class": "",
        "display": "2",
        "display_readonly": "2",
        "hint": "",
        "label_class": "",
        "label_render_class": "",
        "layout": "",
        "prefix": "",
        "render_class": "",
        "show_on": "",
        "showlabel": "1",
        "suffix": ""
    },
    "required": 0,
    "state": 1,
    "title": "contact field",
    "type": "text"
}

Update Group Fields Contact[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/fields/groups/contact/contact/{group_id} -d

{
    "title": "new contact group",
    "note": "",
    "description": "new description"
}

Group Fields Contact Mail[edit]

  1. Route Group Fields Contact Mail is: "v1/fields/groups/contact/mail"
  2. Working with it is similar to Group Fields Contact.

Group Fields Contact Categories[edit]

  1. Route Group Fields Contact Categories is: "v1/fields/groups/contact/categories"
  2. Working with it is similar to Group Fields Contact.

Content History[edit]

  1. Route Content History is: "v1/contact/contenthistory"
  2. Working with it is similar to Banners Content History.

Content[edit]

Articles[edit]

Get List of Articles[edit]

curl -X GET /api/index.php/v1/content/articles

Get Single Article[edit]

curl -X GET /api/index.php/v1/content/articles/{article_id}

Delete Article[edit]

curl -X DELETE /api/index.php/v1/content/articles/{article_id}

Create Article[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/content/articles -d

{
    "alias": "my-article",
    "articletext": "My text",
    "catid": 64,
    "language": "*",
    "metadesc": "",
    "metakey": "",
    "title": "Here's an article"
}

Currently the options mentioned here are required properties. However the intention is currently to make at least metakey and metadesc optional in the API.

Update Article[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/content/articles/{article_id} -d

{
    "catid": 64,
    "title": "Updated article"
}

Categories[edit]

  1. Route Content Categories is: "v1/content/categories"
  2. Working with it is similar to Banners Categories, note if workflows is enabled then specifying a workflow is required (similarly to the UI).


Fields Articles[edit]

  1. Route Fields Articles is: "v1/fields/content/articles"
  2. Working with it is similar to Fields Contact.

Groups Fields Articles[edit]

  1. Route Groups Fields Articles is: "v1/fields/groups/content/articles"
  2. Working with it is similar to Groups Fields Contact.

Fields Categories[edit]

  1. Route Fields Categories is: "v1/fields/groups/content/categories"
  2. Working with it is similar to Fields Contact.

Content History[edit]

  1. Route Content History is: "v1/content/articles/{article_id}/contenthistory"
  2. Working with it is similar to Banners Content History.

Languages[edit]

Languages[edit]

Get List of Languages[edit]

curl -X GET /api/index.php/v1/languages

Install Language[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages -d

{
    "package": "pkg_fr-FR"
}

Content Languages[edit]

Get List of Content Languages[edit]

curl -X GET /api/index.php/v1/languages/content

Get Single Content Language[edit]

curl -X GET /api/index.php/v1/v1/languages/content/{language_id}

Delete Content Language[edit]

curl -X DELETE /api/index.php/v1/languages/content/{language_id}

Create Content Language[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/content -d

{
    "access": 1,
    "description": "",
    "image": "fr_FR",
    "lang_code": "fr-FR",
    "metadesc": "",
    "metakey": "",
    "ordering": 1,
    "published": 0,
    "sef": "fk",
    "sitename": "",
    "title": "French (FR)",
    "title_native": "Français (France)"
}

Update Content Language[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/languages/content/{language_id} -d

{
    "description": "",
    "lang_code": "en-GB",
    "metadesc": "",
    "metakey": "",
    "sitename": "",
    "title": "English (en-GB)",
    "title_native": "English (United Kingdom)"
}

Overrides Languages[edit]

Get List of Overrides Languages Constants[edit]

curl -X GET /api/index.php/v1/languages/overrides/{app}/{lang_code}

Get Single Override Language Constant[edit]

curl -X GET /api/index.php/v1/languages/overrides/{app}/{lang_code}/{constant_id}

Delete Content Language[edit]

curl -X DELETE /api/index.php/v1/languages/overrides/{app}/{lang_code}/{constant_id}

Create Content Language[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/{app}/{lang_code} -d

{
    "key":"new_key",
    "override": "text"
}

Update Content Language[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/{app}/{lang_code}/{constant_id} -d

{
    "key":"new_key",
    "override": "new text"
}

var app - enum {"site", "administrator"}

var lang_code - string Example: “fr-FR“, “en-GB“ you can get lang_code from v1/languages/content

Search Override Constant[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/search -d

{
    "searchstring": "JLIB_APPLICATION_ERROR_SAVE_FAILED",
    "searchtype": "constant"
}

var searchtype - enum {“constant”, “value”}. “constant” search by constant name, “value” - search by constant value

Refresh Override Search Cache[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/languages/overrides/search/cache/refresh

Menus[edit]

Menus[edit]

Get List of Menus[edit]

curl -X GET /api/index.php/v1/menus/{app}

Get Single Menu[edit]

curl -X GET /api/index.php/v1/menus/{app}/{menu_id}

Delete Menu[edit]

curl -X DELETE /api/index.php/v1/menus/{app}/{menu_id}

Create Menu[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/menus/{app} -d

{
    "client_id": 0,
    "description": "The menu for the site",
    "menutype": "menu",
    "title": "Menu"
}

Update Menu[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/{menu_id} -d

{
    "menutype": "menu",
    "title": "New Menu"
}

Menus Items[edit]

Get List of Menus Items Types[edit]

curl -X GET /api/index.php/v1/menus/{app}/items/types

Get List of Menus Items[edit]

curl -X GET /api/index.php/v1/menus/{app}/items

Get Single Menu Item[edit]

curl -X GET /api/index.php/v1/menus/{app}/items/{menu_item_id}

Delete Menu Item[edit]

curl -X DELETE /api/index.php/v1/menus/{app}/items/{menu_item_id}

Create Menu Item[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/items -d

{
    "access": "1",
    "alias": "",
    "associations": {
        "en-GB": "",
        "fr-FR": ""
    },
    "browserNav": "0",
    "component_id": "20",
    "home": "0",
    "language": "*",
    "link": "index.php?option=com_content&view=form&layout=edit",
    "menutype": "mainmenu",
    "note": "",
    "params": {
        "cancel_redirect_menuitem": "",
        "catid": "",
        "custom_cancel_redirect": "0",
        "enable_category": "0",
        "menu-anchor_css": "",
        "menu-anchor_title": "",
        "menu-meta_description": "",
        "menu-meta_keywords": "",
        "menu_image": "",
        "menu_image_css": "",
        "menu_show": "1",
        "menu_text": "1",
        "page_heading": "",
        "page_title": "",
        "pageclass_sfx": "",
        "redirect_menuitem": "",
        "robots": "",
        "show_page_heading": ""
    },
    "parent_id": "1",
    "publish_down": "",
    "publish_up": "",
    "published": "1",
    "template_style_id": "0",
    "title": "title",
    "toggle_modules_assigned": "1",
    "toggle_modules_published": "1",
    "type": "component"
}

Example for "Create Article Page"

Update Menu Item[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/menus/{app}/items/{menu_item_id} -d

{
    "component_id": "20",
    "language": "*",
    "link": "index.php?option=com_content&view=form&layout=edit",
    "menutype": "mainmenu",
    "note": "",
    "title": "new title",
    "type": "component"
}

Example for "Create Article Page"

Messages[edit]

Messages[edit]

Get List of Messages[edit]

curl -X GET /api/index.php/v1/messages

Get Single Message[edit]

curl -X GET /api/index.php/v1/messages/{message_id}

Delete Message[edit]

curl -X DELETE /api/index.php/v1/messages/{message_id}

Create Message[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/messages -d

{
    "message": "<p>text</p>",
    "state": 0,
    "subject": "text",
    "user_id_from": 773,
    "user_id_to": 772
}

Update Message[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/messages/{message_id} -d

{
    "message": "<p>new text</p>",
    "subject": "new text",
    "user_id_from": 773,
    "user_id_to": 772
}

Modules[edit]

Modules[edit]

Get List of Modules Types[edit]

curl -X GET /api/index.php/v1/modules/types/{app}

Get List of Modules[edit]

curl -X GET /api/index.php/v1/modules/{app}

Get Single Module[edit]

curl -X GET /api/index.php/v1/modules/{app}/{module_id}

Delete Module[edit]

curl -X DELETE /api/index.php/v1/modules/{app}/{module_id}

Create Module[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/modules/{app} -d

{
    "access": "1",
    "assigned": [
        "101",
        "105"
    ],
    "assignment": "0",
    "client_id": "0",
    "language": "*",
    "module": "mod_articles_archive",
    "note": "",
    "ordering": "1",
    "params": {
        "bootstrap_size": "0",
        "cache": "1",
        "cache_time": "900",
        "cachemode": "static",
        "count": "10",
        "header_class": "",
        "header_tag": "h3",
        "layout": "_:default",
        "module_tag": "div",
        "moduleclass_sfx": "",
        "style": "0"
    },
    "position": "",
    "publish_down": "",
    "publish_up": "",
    "published": "1",
    "showtitle": "1",
    "title": "Title"
}

Example for "Articles - Archived"

Update Module[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/modules/{app}/{module_id} -d

{
    "access": "1",
    "client_id": "0",
    "language": "*",
    "module": "mod_articles_archive",
    "note": "",
    "ordering": "1",
    "title": "New Title"
}

Example for "Articles - Archived"

Newsfeeds[edit]

Feeds[edit]

Get List of Feeds[edit]

curl -X GET /api/index.php/v1/newsfeeds/feeds

Get Single Feed[edit]

curl -X GET /api/index.php/v1/newsfeeds/feeds/{feed_id}

Delete Feed[edit]

curl -X DELETE /api/index.php/v1/newsfeeds/feeds/{feed_id}

Create Feed[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/newsfeeds/feeds -d

{
    "access": 1,
    "alias": "alias",
    "catid": 5,
    "description": "",
    "images": {
        "float_first": "",
        "float_second": "",
        "image_first": "",
        "image_first_alt": "",
        "image_first_caption": "",
        "image_second": "",
        "image_second_alt": "",
        "image_second_caption": ""
    },
    "language": "*",
    "link": "https://github.com/joomla-projects/gsoc19_webservices",
    "metadata": {
        "hits": "",
        "rights": "",
        "robots": "",
        "tags": {
            "tags": "",
            "typeAlias": null
        }
    },
    "metadesc": "",
    "metakey": "",
    "name": "Name",
    "ordering": 1,
    "params": {
        "feed_character_count": "",
        "feed_display_order": "",
        "newsfeed_layout": "",
        "show_feed_description": "",
        "show_feed_image": "",
        "show_item_description": ""
    },
    "published": 1
}

Update Feed[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/newsfeeds/feeds/{feed_id} -d

{
    "access": 1,
    "alias": "test2",
    "catid": 5,
    "description": "",
    "link": "https://github.com/joomla-projects/gsoc19_webservices",
    "metadesc": "",
    "metakey": "",
    "name": "Test"
}

Categories[edit]

  1. Route Newsfeeds Categories is: "v1/newsfeeds/categories"
  2. Working with it is similar to Banners Categories.

Privacy[edit]

Request[edit]

Get List of Requests[edit]

curl -X GET /api/index.php/v1/privacy/request

Get Single Request[edit]

curl -X GET /api/index.php/v1/privacy/request/{request_id}

Get Single Request Export Data[edit]

curl -X GET /api/index.php/v1/privacy/request/export/{request_id}

Create Request[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/privacy/request -d

{
    "email":"somenewemail@com.ua",
    "request_type":"export"
}

Consent[edit]

Get List of Consents[edit]

curl -X GET /api/index.php/v1/privacy/consent

Get Single Consent[edit]

curl -X GET /api/index.php/v1/privacy/consent/{consent_id}

Delete Consent[edit]

curl -X DELETE /api/index.php/v1/privacy/consent/{consent_id}

Redirect[edit]

Redirect[edit]

Get List of Redirects[edit]

curl -X GET /api/index.php/v1/redirect

Get Single Redirect[edit]

curl -X GET /api/index.php/v1/redirect/{redirect_id}

Delete Redirect[edit]

curl -X DELETE /api/index.php/v1/redirect/{redirect_id}

Create Redirect[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/redirect -d

{
    "comment": "",
    "header": 301,
    "hits": 0,
    "new_url": "/content/art/99",
    "old_url": "/content/art/12",
    "published": 1,
    "referer": ""
}

Update Redirect[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/redirect/{redirect_id} -d

{
    "new_url": "/content/art/4",
    "old_url": "/content/art/132"
}

Tags[edit]

Tags[edit]

Get List of Tags[edit]

curl -X GET /api/index.php/v1/tags

Get Single Tag[edit]

curl -X GET /api/index.php/v1/tags/{tag_id}

Delete Tag[edit]

curl -X DELETE /api/index.php/v1/tags/{tag_id}

Create Tag[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/tags -d

{
    "access": 1,
    "access_title": "Public",
    "alias": "test",
    "description": "",
    "language": "*",
    "note": "",
    "parent_id": 1,
    "path": "test",
    "published": 1,
    "title": "test"
}

Update Tag[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/tags/{tag_id} -d

{
    "alias": "test",
    "title": "new title"
}

Templates[edit]

Templates Styles[edit]

Get List of Templates Styles[edit]

curl -X GET /api/index.php/v1/templates/styles/{app}

Get Single Template Style[edit]

curl -X GET /api/index.php/v1/templates/styles/{app}/{template_style_id}

Delete Template Style[edit]

curl -X DELETE /api/index.php/v1/templates/styles/{app}/{template_style_id}

Create Template Style[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/templates/styles/{app} -d

{
    "home": "0",
    "params": {
        "fluidContainer": "0",
        "logoFile": "",
        "sidebarLeftWidth": "3",
        "sidebarRightWidth": "3"
    },
    "template": "cassiopeia",
    "title": "cassiopeia - Some Text"
}

Update Template Style[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/templates/styles/{app}/{template_style_id} -d

{
	"template": "cassiopeia",
	"title": "new cassiopeia - Default"
}

Users[edit]

Users[edit]

Get List of Users[edit]

curl -X GET /api/index.php/v1/users

Get Single User[edit]

curl -X GET /api/index.php/v1/users/{user_id}

Delete User[edit]

curl -X DELETE /api/index.php/v1/users/{user_id}

Create User[edit]

curl -X POST -H "Content-Type: application/json" /api/index.php/v1/users -d

{
    "block": "0",
    "email": "test@mail.com",
    "groups": [
        "2"
    ],
    "id": "0",
    "lastResetTime": "",
    "lastvisitDate": "",
    "name": "nnn",
    "params": {
        "admin_language": "",
        "admin_style": "",
        "editor": "",
        "helpsite": "",
        "language": "",
        "timezone": ""
    },
    "password": "qwertyqwerty123",
    "password2": "qwertyqwerty123",
    "registerDate": "",
    "requireReset": "0",
    "resetCount": "0",
    "sendEmail": "0",
    "username": "ad"
}

Update User[edit]

curl -X PATCH -H "Content-Type: application/json" /api/index.php/v1/users/{user_id} -d

{
    "email": "new@mail.com",
    "groups": [
        "2"
    ],
    "name": "name",
    "username": "username"
}

Fields Users[edit]

  1. Route Fields Users is: v1/fields/users
  2. Working with it is similar to Fields Contact.

Groups Fields Users[edit]

  1. Route Groups Fields Users is: v1/fields/groups/users
  2. Working with it is similar to Groups Fields Contact.