Creating Files - ACS - Reference Guides

ACS Integration Guide

Product
ACS
AFS_Version
7.9
Category
Reference Guides
language
English
audience
public

To add a file into a book or folder, a CKS user must first create a multifacet file using the POST method on the multifile list resource relative to this book or this folder.

WADL file

Resource

Method

file.wadl

/cks/instance/<service_id>-${Service_Status}/book/
{book_id}/
multifile

POST

Then the user must create the file using the POST method on the file list resource relative to this multifacet file.

WADL file

Resource

Method

file.wadl

/cks/instance/<service_id>-${Service_Status}/book/
{book_id}/
multifile/{mfile_id}/file/{file_name}

POST

The following examples show these two necessary steps to create a file.

The first step consists in creating the multifacet file in the book /cks/instance/<service_id>-${Service_Status}/book/. The id of this new object is 53 and its reference is /cks/instance/<service_id>-${Service_Status}/book/13/multifile/53.

The request line is:

POST /cks/instance/<service_id>-${Service_Status}/book/13/multifile?afs:login=login://aeinstein:albert@CKS/<service_id>-${Service_Status}

The request body is:

<result xsi:type="cks.ws.multifile" xmlns="antidot:cks:input"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<description>This is a multifacet file</description>
<name>Multifile of Albert</name>
</result>

The reply body is:

<value xsi:type="ws.response" xmlns="antidot:cks:output"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<result xsi:type="cks.ws.multifile"
reference="/cks/instance/<service_id>-${Service_Status}/book/13/multifile/53">
<id>53</id>
<description>This is a multifacet file</description>
<name>Multifile of Albert</name>
</result>
</value>

The second step consists in creating the file within this multifacet file. The name of this file is my_file.pdf and its reference is /cks/instance/<service_id>-${Service_Status}/book/13/multifile/53/file/my_file.pdf

The request line is:

POST /cks/instance/<service_id>-${Service_Status}/book/13/multifile/53/my_file.pdf?afs:login=login://aeinstein:albert@CKS/<service_id>-${Service_Status}

The request body is the content of the serialized file.

The reply body is:

<value xsi:type="ws.response" xmlns="antidot:cks:output"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<result xsi:type="cks.ws.file"
reference="/cks/instance/<service_id>-${Service_Status}/book/13/multifile/53/file/my_file.pdf">
<title>my_file.pdf</title>
<mimetype>application/pdf</mimetype>
</result>
</value>