API returns invalid JSON #1695

Open
opened 2026-10-05 00:53:17 +02:00 by adam · 1 comment
Owner

If I make an API request with a mothode like pwg.groups.add I get invalid JSON data back:

{ stat: "ok", result: { username: "Chewie", status: "webmaster", theme: "bootstrap_darkroom", language: "de_DE", pwg_token: "7407944da77474e", charset: "utf-8", current_datetime: "2023-07-09 13:41:51", version: 13.8.0, available_sizes: [ "square", "thumb", "2small", "xsmall", "small", "medium", "large", "xlarge", "xxlarge" ], upload_file_types: "jpg,jpeg,png,gif", upload_form_chunk_size: 500 } }

The correct code would be:

{ stat: "ok", result: { username: "Chewie", status: "webmaster", theme: "bootstrap_darkroom", language: "de_DE", pwg_token: "7407944da77474e", charset: "utf-8", current_datetime: "2023-07-09 13:41:51", version: "13.8.0", available_sizes: [ "square", "thumb", "2small", "xsmall", "small", "medium", "large", "xlarge", "xxlarge" ], upload_file_types: "jpg,jpeg,png,gif", upload_form_chunk_size: 500 } }

Please change the output so that the program version is in quotes!

version: 13.8.0
version: "13.8.0"

If I make an API request with a mothode like pwg.groups.add I get invalid JSON data back: ` { stat: "ok", result: { username: "Chewie", status: "webmaster", theme: "bootstrap_darkroom", language: "de_DE", pwg_token: "7407944da77474e", charset: "utf-8", current_datetime: "2023-07-09 13:41:51", version: 13.8.0, available_sizes: [ "square", "thumb", "2small", "xsmall", "small", "medium", "large", "xlarge", "xxlarge" ], upload_file_types: "jpg,jpeg,png,gif", upload_form_chunk_size: 500 } } ` The correct code would be: ` { stat: "ok", result: { username: "Chewie", status: "webmaster", theme: "bootstrap_darkroom", language: "de_DE", pwg_token: "7407944da77474e", charset: "utf-8", current_datetime: "2023-07-09 13:41:51", version: "13.8.0", available_sizes: [ "square", "thumb", "2small", "xsmall", "small", "medium", "large", "xlarge", "xxlarge" ], upload_file_types: "jpg,jpeg,png,gif", upload_form_chunk_size: 500 } } ` Please change the output so that the program version is in quotes! version: 13.8.0 version: "13.8.0" <!-- github-sync-id:1795376828 -->
Author
Owner

pwg.getInfos has the same problem with the version without quotes.

pwg.getInfos has the same problem with the version without quotes. <!-- github-comment-id:1627768157 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1695