You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- A collection of Joomla endpoints to use in Postman: https://github.com/alexandreelise/j4x-api-collection
14
15
15
16
## Using the Joomla framework
17
+
16
18
More often than not, when using the Joomla framework, under the hood it still uses cURL or php streams. Most of the cURL is available with your web hosting provider. Otherwise check phpinfo();
17
19
You should be able to follow along because the examples using the Joomla framework will mimic those with cURL.
18
20
@@ -202,26 +204,31 @@ The cURL functions needs to be available and enabled in your PHP configuration,
202
204
203
205
### Define some variables
204
206
First we define some variables that we use in all our cURL requests:
207
+
205
208
- the URL of your Joomla 4.x website and
206
209
- the Joomla's API Token of a Super User account or an account which has at least core.login.api permission and core.login.site to be able to see change current logged-in user's token.
207
210
208
211
209
212
213
+
210
214
```php
211
215
// Before passing the HTTP METHOD to CURL
212
216
$curl = curl_init();
217
+
213
218
$url = 'https://example.org/api/index.php/v1';
214
219
215
220
// Put your Joomla! Api token in a safe place, for example a password manager or a vault storing secrets
216
221
// We should not use environment variables to store secrets.
217
222
// Here is why: https://www.trendmicro.com/en_us/research/22/h/analyzing-hidden-danger-of-environment-variables-for-keeping-secrets.html
218
223
$token = '';
224
+
219
225
```
220
226
221
227
### POST - Create an Article in the Category "Uncategorized" (Category ID = 2)
0 commit comments