12345678910111213141516171819202122232425 |
- <?php
- require_once __DIR__ . '/../include/config.php';
- require_once __DIR__ . '/../include/api.php';
- header('Content-Type: application/json');
- if (!isset($_GET['ids']) || !is_array($_GET['ids']) || count($_GET['ids']) > 50) {
- http_response_code(400);
- die('[]');
- }
- foreach($_GET['ids'] as $id) {
- if (!ctype_digit($id)) {
- http_response_code(400);
- die('[]');
- }
- }
- /* `11`: intentional, must be a valid user id for the endpoint to work */
- list($artworks, $error) = get_user_artworks(11, $_GET['ids']);
- if ($error) {
- http_response_code(500);
- die('[]');
- }
- echo json_encode($artworks->body->works);
|