Containeur (API)
De Wiki1000
Version du 10 mars 2020 à 16:44 par Syfre (discuter | contributions)
Les containers peuvent être accédés en HTTP via l'API SData
Opération | Support | HTTP |
---|---|---|
Liste des containers | xml, json | GET |
Propriété de container | xml, json | GET |
Liste des documents d'un container | xml, json | GET |
Obtenir un document | xml | GET |
Ajouter un document | xml | POST |
Supprimer un document | xml,json | DELETE |
Exemples :
Liste des containers :
GET URL:https://xx/myservice/server/sdata/l1000/admin/-/containers OK :200 Request Header Host = xx Request Header Accept = application/xml Request Header Accept-Charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7 Request Header Accept-Language = en-us,en;q=0.5 Response Connection=close Response Header Connection = close Response Header Content-Type = application/atom+xml; charset=UTF-8 Response Header Content-Length = 20322 Response Header Date = Thu, 11 Jan 2018 14:14:30 GMT Response Header Last-Modified = Sat, 30 Dec 1899 00:00:00 GMT // // Content is container list in format depending of request's Accept //
Liste des documents d'un container:
GET URL:https://xx/myservice/server/sdata/l1000/admin/-/container(000000000000000000AE0000281B0009)/documents OK :200 Request Header Host = xx Request Header Accept = application/xml Request Header Accept-Charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7 Request Header Accept-Language = en-us,en;q=0.5 Response Connection=close Response CacheControl= Response Header Connection = close Response Header Content-Type = application/atom+xml; charset=UTF-8 Response Header Content-Length = 4879017 Response Header Date = Thu, 11 Jan 2018 14:16:54 GMT Response Header Last-Modified = Sat, 30 Dec 1899 00:00:00 GMT // // Response is document list in format depending of request's Accept //
Obtenir un document (download) :
GET URL:https://xx/myservice/server/sdata/l1000/admin/-/container(000000000000000000AE0000281B0009)/document?name=FAC000001_3B0B57614C0D40BEBC46E37D2B25.pdf OK :200 Request Header Host = xx Request Header Accept = application/octet-stream Request Header Accept-Charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7 Request Header Accept-Language = en-us,en;q=0.5 Response Connection=close Response CacheControl= Response Header Connection = close Response Header Content-Type = application/pdf; charset=ISO-8859-1 Response Header Content-Length = 17378 Response Header Date = Thu, 11 Jan 2018 14:28:18 GMT Response Header Last-Modified = Sat, 30 Dec 1899 00:00:00 GMT // // Request Accept must be application/octet-stream // Response is document in octet-stream // Response Content-Type is set depending of document /
Ajouter un document (upload) :
POST : URL:https://xx/myservice/server/sdata/l1000/admin/-/container(000000000000000000AE0000281B0009)/$service/upload Request Content-Type = application/octet-stream Request Content-Disposition = attachment; filename="facs-FC ETS000003.pdf" // // Content-Type is required // Content-Disposition is required // Request content is the binary encoded data //
Supprimer un document :
DELETE https://xx/myservice/server/sdata/l1000/admin/-/container(000000000000000000AE0000281B0009)/document?name=facs-FC ETS000003.pdf