Community articleDocument PATCH8.5.3 UP1
Added by IBM contributorIBM on October 24, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars1 comment

Updates selected items in a document.

Defined in: Document resource

Input
Method URI Description
POST /{database}/api/data/documents/unid/{docunid} Updates selected items in a document.
Content Type: application/json
Name Type Optional Description
database
string No Path name of a database on the server relative to the data directory.
docunid
string No Universal ID of a document in the database.
Name Type Optional Description
computewithform
boolean Yes Runs the Domino form formulas against the request data before posting the data. You must identify the form.
form
string Yes Associates a Domino form with the document.
Name Type Optional Description
Content-Type
string No Must be application/json.
If-Unmodified-Since
9.0
date Yes Date and time in RFC 1123 time format, for example, Tue, 23 Aug 2011 21:35:18 GMT, as previously returned in the Last-Modified response header of a GET for the same document
X-HTTP-Method-Override
string No Must be PATCH. Overrides the POST method with PATCH.
Output
Code Description
200
OK. Indicates that the request was processed successfully.
412
Precondition failed. This status code is returned only if the If-Unmodified-Since header is included in the request and the document has been modified since the specified date.
Examples
This request changes a string item in a document:
POST /XPagesExt.nsf/api/data/documents/unid/D73CD922E372C494852578B600584F03
Content-Type: application/json
X-HTTP-Method-Override: PATCH

{"City":"Milngavie"}

For this request, the City field on the Contact form contains the input translation formula @ProperCase(City). The value of the field after the data is posted is New York City.
POST /XPagesExt.nsf/api/data/documents/unid/5D006566E919779E852578B7004A6019?form=Contact&computewithform=true
Content-Type: application/json
X-HTTP-Method-Override: PATCH

{"City":"new york city"}

Alex Zimarev commented on Dec 16, 2015

Re: Document PATCH

POST gives "method not allowed" but PATCH works fine.