Cisco WebEx Social API Reference Guide, Release 3.0
Document File Resource Operations
Downloads: This chapterpdf (PDF - 184.0KB) The complete bookPDF (PDF - 14.42MB) | Feedback

Document File Resource Operations

Table Of Contents

Document File Resource Operations

Get Information about the Current Version of a Document File

Get Information about the Designated Version of a Document File

Get Information about All Versions of a Document File

Upload a Document File

Update Information about a Document File

Delete the Designated Version of a Document File

Delete all Versions of a Document File


Document File Resource Operations


A Cisco WebEx Social document file is a text or binary file that is stored in a document folder in the document library of a user or a community.

The Cisco WebEx Social API Document resource operations let you obtain information about document files and perform various actions with document files.

Table 8-1 provides a summary of the Document File resource operations. Each operation is described in detail in the section that is listed.

These sections provide this information:

Purpose—Brief explanation of the operation

Availability—Cisco WebEx Social releases that support the operation

Request—HTTP method and URI for the operation

Request Payload—Description of the request payload, if the operation requires one

Response—Description of the expected response when the operation executes

Examples—Sample requests and responses for the operation

Table 8-1 Document Resource Operations Summary 

Operation and Reference
Purpose

Get Information about the Current Version of a Document File

Retrieves information about the current version of the designated document file

Get Information about the Designated Version of a Document File

Retrieves information about the designated version of the designated document file

Get Information about All Versions of a Document File

Retrieves information about all versions of the designated document file

Upload a Document File

Uploads the designated document file to the designated folder

Update Information about a Document File

Updates information about the designated document file

Delete the Designated Version of a Document File

Deletes the designated version of the designated document file from the document folder that contains it

Delete all Versions of a Document File

Deletes all versions of the designated document file from the document folders that contain them


Get Information about the Current Version of a Document File

Purpose

Retrieves information about the current version of the designated document file.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

GET

http://server[:port_number]/api/quad/rest/documents/document_id/
[?query_parameters]


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

document_id

Identifier of the document file for which to retrieve information. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.

query_parameters

Query parameters. See the "Query Parameters" section for information about using query parameters. For this operation:

The fields query parameter is supported for selecting fields from the DocumentFile resource to include in a response (Table 3-13 describes these fields)

The filterBy query parameter is not supported for filtering resources in a response

The sortOrder query parameter does not apply

The startIndex query parameter does not apply

The count query parameter does not apply

The meta query parameter does not apply


Request Payload

A request payload is not required.

Response

Standard response (see the "API Responses" section) with a response payload that can include one DocumentFile resource (the "DocumentFile Resource" section describes this resource). XML and JSON formats are supported.

XML Example

Request

GET http://webexsocialserver/api/quad/rest/documents/15468
Accept:application/xml

Response

HTTP/1.1 200 OK
Content-Type: application/xml
 
   

The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: XML Format, One Resource Returned" section.

JSON Example

Request

GET http://webexsocialserver/api/quad/rest/documents/15468
Accept:application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json
 
   

The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: JSON Format, One Resource Returned" section.

Get Information about the Designated Version of a Document File

Purpose

Retrieves information about the designated version of the designated document file.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

GET

http://server[:port_number]/api/quad/rest/documents/document_id/versions/
version_id/[?query_parameters]


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

document_id

Identifier of the document file for which to retrieve information. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.

version_id

Identifier of the version of the document file for which to retrieve information. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.

query_parameters

Query parameters. See the "Query Parameters" section for information about using query parameters. For this operation:

The fields query parameter is supported for selecting fields from the DocumentFile resource to include in a response (Table 3-13 describes these fields)

The filterBy query parameter is not supported for filtering resources in a response

The sortOrder query parameter does not apply

The startIndex query parameter does not apply

The count query parameter does not apply

The meta query parameter does not apply


Request Payload

A request payload is not required.

Response

Standard response (see the "API Responses" section) with a response payload that can include one DocumentFile resource (the "DocumentFile Resource" section describes this resource). XML and JSON formats are supported.

XML Example

Request

GET http://webexsocialserver/api/quad/rest/documents/15468/versions/4689 
Accept:application/xml

Response

HTTP/1.1 200 OK
Content-Type: application/xml
 
   

The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: XML Format, One Resource Returned" section.

JSON Example

Request

GET http://webexsocialserver/api/quad/rest/documents/15468/versions/4689
Accept:application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json
 
   

The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: JSON Format, One Resource Returned" section.

Get Information about All Versions of a Document File

Purpose

Retrieves information about all versions of the designated document file.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

GET

http://server[:port_number]/api/quad/rest/documents/document_id/versions
[?query_parameters]


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

document_id

Identifier of the document file for which to retrieve information. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.

query_parameters

Query parameters. See the "Query Parameters" section for information about using query parameters. For this operation:

The fields query parameter is supported for selecting fields from the DocumentFile resource to include in a response (Table 3-13 describes these fields)

The filterBy query parameter is not supported for filtering resources in a response

The sortOrder query parameter is not supported for sorting resources in a response

The startIndex query parameter is not supported for paginating return results

The count query parameter is not supported for designating the maximum number of items in the return results

The meta query parameter does not apply


Request Payload

A request payload is not required.

Response

Standard response (see the "API Responses" section) with a response payload that can include one or more DocumentFile resources (the "DocumentFile Resource" section describes this resource). XML and JSON formats are supported.

XML Example

Request

GET http://webexsocialserver/api/quad/rest/documents/15468/versions
Accept:application/xml

Response

HTTP/1.1 200 OK
Content-Type: application/xml
 
   

The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: XML Format, Multiple Resources Returned" section

JSON Example

Request

GET http://webexsocialserver/api/quad/rest/documents/15468/versions
Accept:application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json
The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: JSON Format, Multiple Resources Returned" section

Upload a Document File

Purpose

Uploads the designated document file to the designated folder.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

POST

http://server[:port_number]/api/quad/rest/documents[?query_parameters]


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

query_parameters

Query parameters. See the "Query Parameters" section for information about using query parameters. For this operation:

The fields query parameter is supported for selecting fields from the DocumentFile resource to include in a response (Table 3-13 describes these fields)

The filterBy query parameter is not supported for filtering resources in a response

The sortOrder query parameter does not apply

The startIndex query parameter does not apply

The count query parameter does not apply

The meta query parameter does not apply


Request Payload

The HTTP Content-Type header must be multipart/form-data for this request. The request payload includes the following fields from the DocumentFile resource (Table 3-13 describes these fields). These fields must be specified in the form field=value. The form-data key file=file_to_upload also must be specified.

Required Fields
Optional Fields

folderId

description
tags
title


Response

Standard response (see the "API Responses" section) with a response payload that can include one DocumentFile resource (the "DocumentFile Resource" section describes this resource). XML and JSON formats are supported.

XML Example

Request

POST http://webexsocialserver/api/quad/rest/documents
content-type: multipart/form-data; 
 
   
boundary=Boundary_1_1884243356_1338281290132
accept: application/xml
content-length: 755
--Boundary_1_1884243356_1338281290132
Content-Type: text/plain  Content-Disposition: form-data; filename="Test.txt";
<binary_file>  
name="file" Test
--Boundary_1_1884243356_1338281290132
Content-Type: text/plain  
Content-Disposition: form-data; name="title" Test Document Title  
--Boundary_1_1884243356_1338281290132
Content-Type: text/plain  
Content-Disposition: form-data; 
name="description" Test Document Description  
--Boundary_1_1884243356_1338281290132
Content-Type: text/plain  
Content-Disposition: form-data; 
name="tags" TestTag1,TestTag2  
--Boundary_1_1884243356_1338281290132
Content-Type: text/plain  
Content-Disposition: form-data; 
name="folderid" 110097  
--Boundary_1_1884243356_1338281290132--

Response

HTTP/1.1 201 Created
Location            : http://172.27.9.196:8080/quadopen/api/rest/documents/110232
Content-Type        : application/xml
 
   

The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: XML Format, One Resource Returned" section.

JSON Example

Request

POST http://webexsocialserver/api/quad/rest/documents
content-type: multipart/form-data; boundary=Boundary_1_820233764_1338283540952
 
   
accept: application/json
content-length: 768
--Boundary_1_820233764_1338283540952
Content-Type: text/plain  
Content-Disposition: form-data; filename="Test.txt";
<binary_file>
name="file"    Test  
--Boundary_1_820233764_1338283540952
Content-Type: text/plain  
Content-Disposition: form-data; 
name="title"    Test Document Title  
--Boundary_1_820233764_1338283540952
Content-Type: text/plain  
Content-Disposition: form-data; 
name="description"    Test Document Description  
--Boundary_1_820233764_1338283540952
Content-Type: text/plain  
Content-Disposition: form-data; 
name="tags"    TestTag1,TestTag2  
--Boundary_1_820233764_1338283540952
Content-Type: text/plain  
Content-Disposition: form-data; 
name="folderid"    110097  
--Boundary_1_820233764_1338283540952--

Response

HTTP/1.1 201 Created
Location       :  http://172.27.9.196:8080/quadopen/api/rest/documents/110242
 
   

The response can also include the DocumentFile resource. For an example, see the "DocumentFile Resource Response: JSON Format, One Resource Returned" section.

Update Information about a Document File

Purpose

Updates information about the designated document file.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

PUT

http://server[:port_number]/api/quad/rest/documents/document_id


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

document_id

Identifier of the document file for which to update information. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.


Request Payload

The HTTP Content-Type header must be multipart/form-data for this request. The request payload includes the following fields from the DocumentFile resource (Table 3-13 describes these fields). These fields must be specified in the form field=value. The form-data key file=file_to_upload also must be specified.

Required Fields
Optional Fields

folderId

description
tags
title


Response

Standard response (see the "API Responses" section) with an HTTP header only.

XML Example

Request

PUT http://webexsocialserver/api/quad/rest/documents/110242
content-type: multipart/form-data;
 
   
boundary=Boundary_1_833984911_1338287453155
accept: application/xml
content-length: 774
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; filename="Test.txt";
<binary_file>
name="file"    Test
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="title"    Test Document Title Updated  
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="description"    Test Document Description Updated  
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="tags"    NewTag1  
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="folderid"    110097  
--Boundary_1_833984911_1338287453155--

Response

HTTP/1.1 204 No Content

JSON Example

Request

PUT http://webexsocialserver/api/quad/rest/documents/110242
content-type        : multipart/form-data;
 
   
boundary=Boundary_1_833984911_1338287453155
accept              : application/json
content-length      : 774
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; filename="Test.txt";
<binary_file>
name="file"    Test
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="title"    Test Document Title Updated  
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="description"    Test Document Description Updated  
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="tags"    NewTag1  
--Boundary_1_833984911_1338287453155
Content-Type: text/plain  
Content-Disposition: form-data; 
name="folderid"    110097  
--Boundary_1_833984911_1338287453155--

Response

HTTP/1.1 204 No Content

Delete the Designated Version of a Document File

Purpose

Deletes the designated version of the designated document file from the document folder that contains it.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

DELETE

http://server[:port_number]/api/quad/rest/documents/document_id/versions/
version_id


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

document_id

Identifier of the document file for which to delete the designated version. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.

version_id

Identifier of the version of the document file to delete. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.


Request Payload

A request payload is not required.

Response

Standard response (see the "API Responses" section) with an HTTP header only.

Example

Request

DELETE http://webexsocialserver/api/quad/rest/documents/15468/versions/4689

Response

HTTP/1.1 204 No Content

Delete all Versions of a Document File

Purpose

Deletes all versions of the designated document file from the document folders that contain them.

Availability

Cisco WebEx Social 3.0 and later.

Request

HTTP Method
URI

DELETE

http://server[:port_number]/api/quad/rest/documents/document_id


where:

server

Host name or IP address of the Cisco WebEx Social server.

port_number

Cisco WebEx Social server port number that is used for communication with the API consumer. Must be provided if the port number is not 80.

document_id

Identifier of the document file for which to delete all versions. For information about obtaining the identifier that you need, see the "Identifiers of Cisco WebEx Social Entities" section.


Request Payload

A request payload is not required.

Response

Standard response (see the "API Responses" section) with an HTTP header only.

Example

Request

DELETE http://webexsocialserver/api/quad/rest/documents/15468

Response

HTTP/1.1 204 No Content