Get Information About a File

Returns information about a specified file

Note: Document is associated with uploaded files in the library. File is associated with files uploaded to posts.

Request
GET

http://<webexsocial-server>/api/quad/rest/files/{file_id}

Authentication Required

Supported since version 3.0 

Example Request and Response
Request Response
GET /api/quad/rest/files/1010010 HTTP/1.1
Host: 192.168.168.160
Authorization: Basic dGVzdEBjaXNjby5jb206Y2lzY28=
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
Content-Type: application/json
Accept: application/json
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: COOKIE_SUPPORT=true; JSESSIONID=EF18C90E30E7ED8DBEE31D147145E8B8.localhost.cisco.comjvm; GUEST_LANGUAGE_ID=en_US 


            
HTTP/1.1 200 OK
Date: Thu, 12 Jul 2012 21:19:46 GMT
Server: Apache
Content-Encoding: gzip
Content-Length: 370
Content-Type: application/json;charset=UTF-8 
{
    "statusCode": 200,
    "startIndex": 0,
    "itemsPerPage": 1,
    "totalResults": 1,
    "filtered": false,
    "sorted": false,
    "entry": [{
        "data": {
            "author": {
                "firstName": "Test",
                "fullName": "Test Test",
                "id": 10260,
                "images": [],
                "jobTitle": "",
                "lastName": "Test",
                "resource": "http://quad.cisco.com/schema/1.0/user",
                "screenName": "test",
                "status": "ACTIVE"
            },
            "fileName": "Attachment.docx",
            "id": 1010010,
            "mimeType": "DOCUMENT",
            "published": 1342127370905,
            "resource": "http://quad.cisco.com/schema/1.0/attachment",
            "size": 9878,
            "updated": 1342127370905,
            "updatedBy": null,
            "uri": "/c/post_action/get_attachment?postId=500001&attachmentId=1010010"
        }
    }],
    "serverMessages": null
}

	    

Upload a File

Returns uploaded file's information.

Request
POST

http://<webexsocial-server>/api/api/quad/rest/files

 

Authentication Required

Supported since version 3.0

Example Request and Response
Request Response
POST /api/quad/rest/files HTTP/1.1
Host: 192.168.168.160
Content-Length: 229
Origin: chrome-extension://cokgbflfommojglbmbpenpphppikmonn
Authorization: Basic dGVzdEBjaXNjby5jb206Y2lzY28=
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarycT0TSAOtUA4ELZe0
Accept: application/json
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: COOKIE_SUPPORT=true; JSESSIONID=EF18C90E30E7ED8DBEE31D147145E8B8.localhost.cisco.comjvm; GUEST_LANGUAGE_ID=en_US

------WebKitFormBoundarycT0TSAOtUA4ELZe0
Content-Disposition: form-data; name="file"; filename="file.txt"
Content-Type: text/plain

POST http://quadserver]/api/api/quad/rest/files
------WebKitFormBoundarycT0TSAOtUA4ELZe0—

            
HTTP/1.1 201 Created
Date: Thu, 12 Jul 2012 21:44:24 GMT
Server: Apache
Location: http://192.168.168.160/quadopen/api/rest/files/1010021
Content-Encoding: gzip
Content-Length: 329
Content-Type: application/json;charset=UTF-8 
{
    "statusCode": 200,
    "startIndex": 0,
    "itemsPerPage": 1,
    "totalResults": 1,
    "filtered": false,
    "sorted": false,
    "entry": [{
        "data": {
            "author": {
                "firstName": "Test",
                "fullName": "Test Test",
                "id": 10260,
                "images": [],
                "jobTitle": "",
                "lastName": "Test",
                "resource": "http://quad.cisco.com/schema/1.0/user",
                "screenName": "test",
                "status": "ACTIVE"
            },
            "fileName": "file.txt",
            "id": 1010021,
            "mimeType": "DOCUMENT",
            "published": 1342129464630,
            "resource": "http://quad.cisco.com/schema/1.0/attachment",
            "size": 47,
            "updated": 1342129464630,
            "updatedBy": null,
            "uri": null
        }
    }],
    "serverMessages": null
}

  

Delete a File

Returns code 204 for success.

Request
DELETE

http://<webexsocial-server>/api/quad/rest/files/{file_id}

 

Authentication Required

Supported since version 3.0

Example Request and Response
Request Response
DELETE /api/quad/rest/files/1010010 HTTP/1.1
Host: 192.168.168.160
Content-Length: 0
Origin: chrome-extension://cokgbflfommojglbmbpenpphppikmonn
Authorization: Basic dGVzdEBjaXNjby5jb206Y2lzY28=
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
Content-Type: application/json
Accept: application/json
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: COOKIE_SUPPORT=true; JSESSIONID=EF18C90E30E7ED8DBEE31D147145E8B8.localhost.cisco.comjvm; GUEST_LANGUAGE_ID=en_US
 
HTTP/1.1 204 No Content
Date: Thu, 12 Jul 2012 21:39:00 GMT
Server: Apache
Content-Length: 0
Content-Type: text/plain; charset=UTF-8