The article image is not added via the Joomla 5 API

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
veblis
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sat May 21, 2016 8:58 am

The article image is not added via the Joomla 5 API

Post by veblis » Mon Apr 29, 2024 4:02 pm

The article is recorded in the database without a picture.
In the images field: {}
Please help me solve the problem.

Code: Select all

$url = 'http://localhost/wb/api/index.php/v1/content/articles';
$data = [
    "title" => "New Article",
    "articletext" => "Here is the article text",
    "catid" => 8,
    "language" => "*",
    "images" => json_encode([
		"image_intro" => "images/sampledata/cassiopeia/nasa1-1200.jpg#joomlaImage://local-images/sampledata/cassiopeia/nasa1-1200.jpg?width=1200&height=400",
        "float_intro" => "",
        "image_intro_alt" => "alt",
        "image_intro_caption" => "caption",
        "image_fulltext" => "",
        "float_fulltext" => "",
        "image_fulltext_alt" => "alt",
        "image_fulltext_caption" => "caption"
    ])
];

Post Reply

Return to “Joomla! 5.x Coding”