List documents
List all documents uploaded into your shop document library
GET
/documents/list.json
List all documents uploaded into your shop document library
GET
/documents/list.json
$storeden = new Storeden\Storeden($config);
$documents_list = $storeden->get('/documents/list.json');
[
{
"file_id": "59f704a516f46a3a7c703414",
"file_url": "https://888-backoffice.storeden.com/document-library-view/59f704a516f46a3a7c703414",
"name": "My File",
"size": 10605,
"type": "text/plain",
"uploadDate": 1509360805
},
...
]
GET
/documents/file.json?file_id={id}
file_id required (StoredenId) | Unique id of your file |
$storeden = new Storeden\Storeden($config);
$document = $storeden->get('/documents/file.json?file_id=59f.....3414');
{
"file_id": "59f704a516f46a3a7c703414",
"file_url": "https://888-backoffice.storeden.com/document-library-view/59f704a516f46a3a7c703414",
"name": "My File",
"size": 10605,
"type": "text/plain",
"uploadDate": 1509360805
}
POST
/documents/file.json
name required (string) | Specify a name for your file. Html will be stripped out |
content required (base64) | base64 encoded content of your file |
privacy required (string) | File privacy flag. Accepted values: public or private |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['name'] = 'helloworld.txt';
$payload['content'] = 'SGVsbG8gV29ybGQhCg=='
$payload['privacy'] = 'public';
$result = $storeden->post('/documents/file.json', $payload);
{
"id": "59f707be16f46a3a7c70342b",
"url": "https://132-backoffice.storeden.com/document-library-view/59f707be16f46a3a7c70342b"
}
Permanently remove document.
DELETE
/documents/file.json
file_id required (StoredenId) | Unique id of your file |
$storeden = new Storeden\Storeden($config);
$result = $storeden->delete('/documents/file.json', ['file_id' => '59f7.....342b']);
{
"ok": 1,
"err": null,
}