This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jan 19, 2015, 8:30 AM
1 Posts

Domino Data Access (Update attachments)

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Administrator,Developer
  • Tags:
  • Replies: 1

Hi! 

I try to update the attachment in a document. But the server returns an error 400. I send the request:

PATCH http://servername/prodoc/projects/ob+6.nsf/api/data/documents/unid/DE3B5CD79A8DE3BEC3257DB60023481C?computewithform=true
Content-Type: application/json
{"Body":
    {"type":"multipart","content":
    [
        {
            "contentType":"multipart/mixed; Boundary=\"0__=4CBBF75EDFB8107C8f9e8a93df938690918c4CBBF75EDFB8107C\""
        },
        {
            "contentType":"multipart/alternative; Boundary=\"1__=4CBBF75EDFB8107C8f9e8a93df938690918c4CBBF75EDFB8107C\"",
            "boundary":"--0__=4CBBF75EDFB8107C8f9e8a93df938690918c4CBBF75EDFB8107C"
        },
        {
            "contentType":"text/plain; charset=US-ASCII",
            "data":"(See attached file: Drawing12.dwg)",
            "boundary":"--1__=4CBBF75EDFB8107C8f9e8a93df938690918c4CBBF75EDFB8107C"
        },
        {
            "contentType":"text/html; charset=US-ASCII",
            "contentDisposition":"inline",
            "data":"<html><body><i>(See attached file: Drawing12.dwg)</i></body></html>",
            "boundary":"--1__=4CBBF75EDFB8107C8f9e8a93df938690918c4CBBF75EDFB8107C"
        },
        {
            "contentType":"image/vnd.dwg; name="Drawing12.dwg"",
            "contentID":"<1__=4CBBF75EDFB8107C8f9e8a93df93869091@local>",
            "contentDisposition":"attachment; filename="Drawing12.dwg"",
            "contentTransferEncoding":"base64",
            "data":"<data>",
            "boundary":"--0__=4CBBF75EDFB8107C8f9e8a93df938690918c4CBBF75EDFB8107C"
        }
    ]
    }
}

What could be the problem? Or what am I doing wrong?

I would be grateful for your help.

Jan 19, 2015, 9:25 PM
19 Posts
Unbalanced quotes in the JSON input ...
I was able to reproduce the problem with a variation of your input.  To fix it I escaped the quotes surrounding the file name.  See the bold text below:

        {
            "contentType":"image/vnd.dwg; name=\"Drawing12.dwg\"",
            "contentID":"<1__=4CBBF75EDFB8107C8f9e8a93df93869091@local>",
            "contentDisposition":"attachment; filename=\"Drawing12.dwg\"",
            "data":"<data>",
            "boundary":"--0__=4CBBF75EDFB8107C8f9e8a93df938690918c4CBBF75EDFB8107C"
        }

Hope this helps.

-- Dave

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal