Archivematica API

147 views
Skip to first unread message

federic...@threadsolutions.com

unread,
Aug 2, 2017, 8:31:32 AM8/2/17
to archivematica
Hi all,

I am working on a client on the Archivematica API.
i have some problems on /api/transfer/reingest

i send a POST with body ("Content-Type":"application/json")  : 

{
  "name":"test_ths4",
  "uuid":"1b6ce7ad-e239-4f94-b8d3-be39028668fb"
}



but the response is

{"message": "\"name\" and \"uuid\" are required.", "error": true}


the same on  /api/ingest/reingest

Version 1.6.0


Thanks to all
Federico

Benjamin Simonis

unread,
Jun 18, 2018, 6:52:03 AM6/18/18
to archivematica
Hi,

I'm stucked with the same problem. It looks like Archivematica doesn't receive JSON-Body I send with.

Did you solved it on your own in the meantime?

Kind regards,
Benjamin

rspe...@artefactual.com

unread,
Jun 18, 2018, 11:30:23 PM6/18/18
to archivematica
HI Federico and Benjamin,

I have been looking at this today. I think there are two parts to this issue, 1) It's not clear to me that the request will accept a JSON body as documented, so we need to look at that. And 2) if we use the workaround and send a more standard POST body, e.g.:

curl http://127.0.0.1:62080/api/ingest/reingest \
-H "Authorization: ApiKey test:test" \
-d'name=rein_1&uuid=5a5ad892-9244-458a-bfad-1df645caa323'
We see another issue appear where Archivematica may be looking in the wrong directory to try and initiate the re-ingest.

I have documented some of this here: https://github.com/artefactual/archivematica/issues/1143, and one of the additional limitations here: https://github.com/artefactual/archivematica/issues/1145 

A workaround is to initiate re-ingest via the Storage Service API if you have access to that: https://wiki.archivematica.org/Storage_Service_API#Reingest_AIP

Let us know how it goes though and what you'd like to achieve.

Regarding an Archivematica/API Client then you might also be interested in the Automation Tools work here: https://github.com/artefactual/automation-tools#archivematica-client, amclient.py wraps a lot of the API calls up to be a little more user friendly to use. We make use of it as a module too in places, but it might prove to have some useful command line functionality for you. 

I hope that helps,
Ross
Reply all
Reply to author
Forward
0 new messages