How do I use the autotagging feature via the API ?
In order to use the autotagging feature via API, you need to use the bulk API with an operation of type AUTOTAG
.
First create a selection for the current-user. (you can follow the link in kpk:current-user
in the /api/dam
representation, then the kpk:selections
link in current-user representation) and get the id of the created selection. Then add all your media in your selection by issuing POST request in the medias-collection representation of the selection with all your medias ids. Then use the bulk representation of the selection with the operation type AUTOTAG
.
-
Create a selection for the current-user. (you can follow the link in
kpk:current-user
in the/api/dam
representation, then thekpk:selections
link in current-user representation) and get the id of the created selection.POST /api/dam/users/1234/selections HTTP/1.1 201 Created Location: http://baobab.keepeek.com//api/dam/users/1234/selections/ay4tvio3 Content-Type: application/json+hal,[...] { "id": "ay4tvio3", "expirationDate": "2019-03-28T18:29:31.625Z", "mediaCount": 0, "_links": { "self": { "href": "http://baobab.keepeek.com/api/dam/users/1234/selections/ay4tvio3" }, "curies": [ { "name": "kpk", "href": "http://baobab.keepeek.com/api/doc/rels/{rel}", "templated": true } ], "kpk:medias": { "href": "http://baobab.keepeek.com/api/dam/users/2/selections/ay4tvio3/medias" }, "kpk:terms-of-use": { "href": "http://baobab.keepeek.com/api/dam/users/2/selections/ay4tvio3/terms-of-use" }, "kpk:media-types": { "href": "http://baobab.keepeek.com/api/dam/users/2/selections/ay4tvio3/media-types" }, "kpk:exports": { "href": "http://baobab.keepeek.com/api/dam/users/2/selections/ay4tvio3/exports" }, "kpk:bulks": { "href": "http://baobab.keepeek.com/api/dam/users/2/selections/ay4tvio3/bulks" } } }
-
Add all your media in your selection by issuing POST request in the medias-collection representation of the selection with all your medias ids :
POST /api/dam/users/1234/selections/ay4tvio3/medias-collection Content-Type: application/json { "ids": [ 6646, 1906 ] } HTTP/1.1 201 Created
-
Use the bulk representation of the selection with the operation type
AUTOTAG
.POST /api/dam/users/1234/selections/ay4tvio3/bulks Content-Type: application/json { "operation-type": "AUTOTAG" } HTTP/1.1 204 No Content