API "Approve Transfer" always returns error [AM 1.13.2]

55 views
Skip to first unread message

arth...@gmail.com

unread,
Feb 1, 2022, 1:42:23 PM2/1/22
to archivematica
Hi,
in AM 1.13.2 I am developing a small procedure to perform massive Reingest (I cannot use the Automation Tools).
I proceed like this, using Postman for testing:

1. I call the "Reingest AIP" of the Storage Service, to which I supply as a parameter the UUID of the AIP and in a JSON the values ​​of "pipeline", "reingest_type" and "processing_config".
This works and the Transfer starts.

2. I call the Archivematica "List Unapproved Transfers", from which I take the "type", "directory" and "uuid" of the new Transfer.
This works and I get, for example, this result:
{
    "results": [
        {
            "type": "standard",
            "directory": "AT-NN-001-284a80d5-413f-46c0-850c-c065b190651b",
            "uuid": "284a80d5-413f-46c0-850c-c065b190651b"
        }
    ],
    "message": "Fetched unapproved transfers successfully."
}


3. The I call the "Approve Transfer" of Archivematica, to which I supply "type" and "directory" in a JSON like this:
{
    "type": "standard",
    "directory": "AT-NN-001-284a80d5-413f-46c0-850c-c065b190651b"
}


Unfortunately, the "Approve Transfer" always responds with:
{
    "error": true,
    "message": "Please specify a transfer directory."
}


Maybe there is something I didn't understand about using "Approve Transfer", but I can't get out of it.
Thanks for any suggestions.

AT

Douglas Cerna

unread,
Feb 1, 2022, 1:59:21 PM2/1/22
to archiv...@googlegroups.com
Hello,

Try setting the Content-Type header of the request to the "Approve Transfer" endpoint as application/x-www-form-urlencoded instead of application/json.

--
You received this message because you are subscribed to the Google Groups "archivematica" group.
To unsubscribe from this group and stop receiving emails from it, send an email to archivematic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/archivematica/52c2c302-7944-4cf8-9e04-788892947620n%40googlegroups.com.


--
Douglas Cerna,
Software Developer, Artefactual Systems Inc.
http://www.artefactual.com

arth...@gmail.com

unread,
Feb 2, 2022, 6:53:43 AM2/2/22
to archivematica
Hi Douglas,
this solved.
Thanks so much!

AT
Reply all
Reply to author
Forward
0 new messages