Obviously I need to tell Omeka to which item this get linked but how?
Is there anyone who have succeeded on this? I would be very grateful of any hints.
This is the last bit missing of our Omeka S workflow…
Best,
Ari
TypeError: Argument 2 passed to Omeka\Api\Manager::create() must be of the type array, null given, called in /var/www/html/application/src/Mvc/Controller/Plugin/Api.php on line 94 and defined in /var/www/html/application/src/Api/Manager.php:71
Stack trace:
#0 /var/www/html/application/src/Mvc/Controller/Plugin/Api.php(94): Omeka\Api\Manager->create('media', NULL, Array, Array)
#1 /var/www/html/application/src/Controller/ApiController.php(96): Omeka\Mvc\Controller\Plugin\Api->create('media', NULL, Array)
#2 /var/www/html/application/src/Controller/ApiController.php(181): Omeka\Controller\ApiController->create(NULL, Array)
#3 /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractRestfulController.php(429): Omeka\Controller\ApiController->processPostData(Object(Zend\Http\PhpEnvironment\Request))
#4 /var/www/html/application/src/Controller/ApiController.php(154): Zend\Mvc\Controller\AbstractRestfulController->onDispatch(Object(Zend\Mvc\MvcEvent))
#5 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Omeka\Controller\ApiController->onDispatch(Object(Zend\Mvc\MvcEvent))
#6 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#7 /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(105): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#8 /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractRestfulController.php(313): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#9 /var/www/html/vendor/zendframework/zend-mvc/src/DispatchListener.php(119): Zend\Mvc\Controller\AbstractRestfulController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#10 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /var/www/html/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#13 /var/www/html/index.php(17): Zend\Mvc\Application->run()
At first glance, it seems possible that this is a bug on our side. We recently made significant changes that made arrays required for some calls. We’ll check into it.
Still no luck, the error is the same.
Actually, the endpoint does not seem to matter. I also tried /api/foo and /api/item and still got the same error.
Since examples have accumulated here, let me add a link to a gist with a working Ruby example (using rest-client) to create an item with an uploaded image.