Community articleDocument PUT8.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 stars

Replaces all items in a document.

Defined in: Document resource

Input
Method URI Description
PUT /{database}/api/data/documents/unid/{docunid} Replaces all 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.
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 replaces the content of a document.
PUT /XPagesExt.nsf/api/data/documents/unid/5D006566E919779E852578B7004A6019
Content-Type: application/json

{"FirstName":"Barney", "LastName":"Bloomberg", "EMail":"bb@acme.com", "Number":1.75,
"Date": ["2011-08-21T20:21:00Z", "2011-08-01T14:38:00Z"],
"Body":{"contentType":"text/html", "data":"Just <b>sales</b>.", "type":"richtext"},
"City":"New York City"}


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.
PUT /XPagesExt.nsf/api/data/documents/unid/5D006566E919779E852578B7004A6019?form=Contact&computewithform=true
Content-Type: application/json

{"FirstName":"Barney", "LastName":"Bloomberg", "EMail":"bbbb@acme.com", "Number":1.75,
"Date": ["2011-08-21T20:21:00Z", "2011-08-01T14:38:00Z"],
"Body":{"contentType":"text/html", "data":"Just <b>sales</b>.", "type":"richtext"},
"City":"new york city"}