cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
112
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Matt Farmer on 02-06-2013 03:08:45 PM
I'm trying the various image upload methods but always getting QUAD-500 internal server error.

I've triple checked that I'm sending the POST in the right format against the docs and also experimenting with a browser and FIDDLER proxy.  

HEADERS
Authorization: 'OAuth oauth_consumer_key="afd9f7562a7d221cd1b7cf6f632c3d7cdd5d65e1",oauth_nonce="lnfiyxv4ySXXgn3B6R1KTaxdfattf5bl",oauth_signature_method="PLAINTEXT",oauth_timestamp="1370203144",oauth_version="1.0",oauth_signature="1f1c35a4cb0f46762a1f057d4dec5682af268d4f%26"',  Host: '192.168.1.85',  accept: 'application/json',  'content-type': 'multipart/form-data; boundary=----------------------------02a4bb521c19',  expect: '100-continue',  'Content-length': 1493 



BODY
------------------------------02a4bb521c19
Content-Disposition: form-data; name="file"; filename="ProfilePhotox.png"
[binary data not posted to forum]

I'm passing the same raw byte stream that browsers seem to pass, and have also tried to pass a content-encoding header and translate the content into base 64, but that also doesnt work.  
I've tried with and without the closing boundary as the documents are inconsistent with regards to that.

I think the cause on the server side is a NullPointerExecption on Quad0AuthAuthenticationMessageHandler.verifyyMessageAroundBody6 Line 108 based on the logs, though that could be a red herring.  The session is definetly authenticated and headers I'm sending are good.  

Appreciate if you have any suggestions!

Subject: RE: QUAD-500 On Image Upload
Replied by: Ratnadeep Ray on 03-06-2013 01:21:27 AM
Hi Matt, 

Can you please let us know the WxS version? Also provide the snapshot of the error from the GUI side. 

Regards,
Ratnadeep. 

Subject: RE: QUAD-500 On Image Upload
Replied by: Matt Farmer on 03-06-2013 03:24:03 PM
Ratnadeep Ray:
Hi Matt, 

Can you please let us know the WxS version? Also provide the snapshot of the error from the GUI side. 

Regards,
Ratnadeep. 

3.0.1.10000.194 - the developer VM.

It's a command line Java program so no GUI.  The error is just the QUAD-500 internal server error.

Subject: RE: QUAD-500 On Image Upload
Replied by: Ratnadeep Ray on 10-06-2013 01:35:46 AM
Not sure about this. I would allow the API/SDK folks to comment on this. 

Regards, 
Ratnadeep. 

Subject: RE: QUAD-500 On Image Upload
Replied by: Adrienne Moherek on 10-06-2013 10:35:10 AM
Hi Matt,

I noticed you have OAUTH SIGNATURE METHOD set to PLAINTEXT. Can you try chaning this to:
oauth_signature_method="HMAC-SHA1"

Thanks,
Adrienne

Subject: RE: QUAD-500 On Image Upload
Replied by: Matt Farmer on 16-06-2013 04:19:56 PM
Hi Adrienne

Finally got back to this.

Still no luck getting images uploaded.  It's very fiddly and error messages are very opaque!

I think this is the cause of my QUAD-500:

{statusCode500startIndex0itemsPerPage0totalResults0filteredfalsesortedfalseentry: [0]serverMessages: [1]0:  {message: "java.lang.IllegalArgumentException: The name parameter is not present"description: "Internal server error"code: "QUAD-500"}--}

Im using the request body from here - 
http://www.cisco.com/en/US/docs/collaboration/ecp/api/3_0/ref_guide/documentfile_operations.html#wp1078434

A
nd using the Chrome REST client to avoid any coding errors.  

I've tried with both PLAINTEXT and HMAC signing and this doesnt seem to influence it.  

Do you have any full example requests and responses that will show either an image or a document being uploaded?  The examples on the website use BASIC AUTHENTICATION.


----------------------

I've also been trying to get something in via the profile image API and get this back:

message: "The input argument(s) may not be null."description: "Internal server error"code: "QUAD-500"
 
Request and response copied from http://www.cisco.com/en/US/docs/collaboration/ecp/api/3_0/ref_guide/user_operations.html#wp1472576:

Request 
------------
Accept: application/jsonOrigin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjelooUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36Authorization: OAuth oauth_consumer_key="0d395350f77474c87c6bf4eae3eabc596657a06f",oauth_nonce="qV6kdddddsadfddsdfddsdddssaasdasdddddddsasaafKOs0fqfdHTrrItjUD",oauth_signature_method="PLAINTEXT",oauth_timestamp="1371417018",oauth_token="8d756ecd-89f6-fa68-9374-30dfc3ad49ca",oauth_version="1.0",oauth_signature="72892d8b7758861641cf7088d100dc973084b4c8%26ab2439db1c2b1a34c128ad94f816ec4729260a8c"Content-Type: multipart/form-data; boundary=----------------------------02a4bb521c19 Accept-Encoding: gzip,deflate,sdchAccept-Language: en-GB,en-US;q=0.8,en;q=0.6Cookie: COOKIE_SUPPORT=true; JSESSIONID=1B0BD8F677893F4167F4A69494E11025.localhost.cisco.comjvm; GUEST_LANGUAGE_ID=en_US
------------------------------02a4bb521c19Content-Disposition: form-data; name="file"; filename="ProfilePhoto.jpg"<binary_file>------------------------------02a4bb521c19--



Response headers
----------------------------
Date: Sun, 16 Jun 2013 21:15:00 GMT Server: Apache Content-Encoding: gzip Content-Length: 192 Content-Type: application/json;charset=UTF-8 Set-Cookie: JSESSIONID=FB2A0D261AE546ECD6FB924F904FC774.localhost.cisco.comjvm; Path=/quadopen Connection: close




Subject: RE: QUAD-500 On Image Upload
Replied by: Adrienne Moherek on 18-06-2013 12:08:56 PM
Hi Matt,

Let me reproduce it on Chrome, and I'll provide screenshots shortly.

Thanks,
Adrienne

Subject: RE: QUAD-500 On Image Upload
Replied by: Adrienne Moherek on 18-06-2013 02:37:41 PM
Adrienne Moherek:
Hi Matt,

Let me reproduce it on Chrome, and I'll provide screenshots shortly.

Thanks,
Adrienne


Hi Matt,

1. Use the request URI /api/quad/rest/documents
2. Set the Request Method to POST
3. Set the Content-Type to multipart/form-data
4. Create request parameters with folderid and the folderid value. I figured out that if you don't specify the folder id, it will not work. I'll update this in the API examples. I was able to figure out the folderid value by clicking on the documents folder and looking at the URL. See image folderid.jpg
5. Click choose files and select your file
6. in the parameter key type in file
7. In my example I used Basic Authentication, but you can use OAuth and it will work the same

My screenshots are attached.

Here is my request:
POST /api/quad/rest/documents HTTP/1.1
Content-Length: 10111
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36
Origin: chrome-extension://cokgbflfommojglbmbpenpphppikmonn
Authorization: Basic dGVzdDpjaXNjbw==
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryAG1FX7O94ViCqyqk
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: COOKIE_SUPPORT=true; GUEST_LANGUAGE_ID=en_US

------WebKitFormBoundaryAG1FX7O94ViCqyqk
Content-Disposition: form-data; name="folderid"

4110092
------WebKitFormBoundaryAG1FX7O94ViCqyqk
Content-Disposition: form-data; name="file"; filename="popup.jpg"
Content-Type: image/jpeg



My response header is Status Code: 201
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links