Cisco WebEx Social API Reference Guide, Release 3.4
File Resource Operations
Downloads: This chapterpdf (PDF - 205.0KB) The complete bookPDF (PDF - 15.05MB) | Feedback

File Resource Operations

Table Of Contents

File Resource Operations

Get Information about a File

Upload a File

Delete a File


File Resource Operations


This chapter describes the Cisco WebEx Social API File resource operations. These operations let you upload to the Cisco WebEx Social server a text or binary file (which you can later embed in or attach to a post), obtain information about these files, and delete these files from the Cisco WebEx Social server.

Table 13-1 provides a summary of the 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

Example—Sample request and response for the operation

Table 13-1 File Resource Operations Summary 

Operation and Reference
Purpose

Get Information about a File

Retrieves information about the designated file

Upload a File

Uploads to the Cisco WebEx Social server the image to be embedded in a post or the file to be attached to a post or micropost

Delete a File

Deletes the designated file from the Cisco WebEx Social server


Get Information about a File

Purpose

Retrieves information about the designated file.

Availability

Cisco WebEx Social 3.4 and later.

Request

HTTP Method
URI

GET

{http|https}://server[:port]/api/quad/rest/files/file_id


where:

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

port—Port number on which the Cisco WebEx Social server listens for API requests. The default value is 80.

file_id—Identifier of the file for which to retrieve information. 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 a response payload that can include one File resource (the "File Resource" section describes this resource).

Example

Request

GET http://webexsocialserver/api/quad/rest/files/3344
Accept:application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json
{
    "statusCode": 200, 
    "startIndex": 0, 
    "itemsPerPage": 1, 
    "totalResults": 0,
    "filtered": false, 
    "sorted": false, 
    "entry": [
        {
            "data": {
                "id": 3344, 
                "resource": "", 
                "size": 27571, 
                "published": 1319750716168, 
                "updated": 1319750716168, 
                "fileName": "322675-retro-apple-tv.jpg", 
                "mimeType": "IMAGE", 
                "author": null, 
                "uri": "/image/image_gallery?img_id=2310104&attachmentId=2310100"
            }
        }
    ], 
    "serverMessages": null
}

Upload a File

Purpose

Uploads to the Cisco WebEx Social server the image to be embedded in a post or the file to be attached to a post or a micropost.

Availability

Cisco WebEx Social 3.4 and later.

Request

HTTP Method
URI

POST

{http|https}://server[:port]/api/quad/rest/files[?fileName=filname]


where:

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

port—Port number on which the Cisco WebEx Social server listens for API requests. The default value is 80.

filname—Name of a file that overrides the file that is specified in the request payload.

The fileName parameter is required if you are using Internet Explorer to send this API operation.

Request Payload

File to be uploaded.

The HTTP Content-Type header must be multipart/form-data for this request. The form-data key must be specified as file=file_to_upload. If you are uploading a video file, single-sign on (SSO) must be enabled in Cisco WebEx Social before you execute this operation.

Response

Standard response (see the "API Responses" section) with a response payload that can include one File resource (the "File Resource" section describes this resource).

Example

Request

POST http://quadserver]/api/api/quad/rest/files
accept: application/json
content-length: 87899
 
   
expect: 100-continue
content-type: multipart/form-data; boundary=----------------------------02a4bb521c19
------------------------------02a4bb521c19
Content-Disposition: form-data; name="file"; filename="ProfilePhoto.jpg"
<binary_file>

Response

HTTP/1.1 201 Created
Location: http://webexsocialserver/api/quad/rest/files/2310109
Content-Length: 597
Content-Type: application/json
HTTP/1.1 200 OK
{
    "statusCode": 200, 
    "startIndex": 0, 
    "itemsPerPage": 1, 
    "totalResults": 0,
    "filtered": false, 
    "sorted": false, 
    "entry": [
        {
            "data": {
                "id": 3344, 
                "resource": "", 
                "size": 27571, 
                "published": 1319750716168, 
                "updated": 1319750716168, 
                "fileName": "ProfilePhoto.jpg", 
                "mimeType": "IMAGE", 
                "author": null, 
                "uri": "/image/image_gallery?img_id=2310104&attachmentId=2310100"
            }
        }
    ], 
    "serverMessages": null
}

Delete a File

Purpose

Deletes the designated file from the Cisco WebEx Social server. The file also is deleted from the posts that it is attached to or embedded in.

Availability

Cisco WebEx Social 3.4 and later.

Request

HTTP Method
URI

DELETE

{http|https}://server[:port]/api/quad/rest/files/file_id


where:

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

port—Port number on which the Cisco WebEx Social server listens for API requests. The default value is 80.

file_id—Identifier of the 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/files/455

Response

HTTP/1.1 204 No Content