Documentation

/content/{id} [PATCH]

ThoughtFarmer REST API Method: /content/{id} [PATCH]

Update a content page. Will only updated the provided content properties.

URL:
http://yourserver.com/api/content/{id}

Response Formats:
JSON, XML

HTTP Method(s):
PATCH

Requires Authentication:
true, user making call must pass a valid token parameter and must have edit permissions

Parameters:

Parameter Type Description
id int Required. The content id of the content to update
title string(255) The title of the content
body string The body text of the content
culture string(5) The culture of the content. If not supplied or not valid, defaults to the culture of the user adding the content.
pageType string Page, Section, Calendar, PhotoGallery, NewsBlog, Forum, Group, Post, CalendarEvent, Document, ForumTopic
isPublished bool true, false. False will set the page to be Private.
token string Required. A valid token authentication parameter

Parameters for 'CalendarEvent' page type:
Parameter Type Description
startDate string
ISO 8601 date string representing the desired start date. If a valid date format not in ISO 8601 is used (with no timezone), then the logged in user's timezone will be used instead.
endDate string ISO 8601 date string representing the desired end date. If a valid date format not in ISO 8601 is used (with no timezone),
then the logged in user's timezone will be used instead. If not supplied then the default event length of 1 hour will be used.
isAllDay bool true, false. True to set the event to an all day event.
eventType int Integer representing the eventType for the event. Can be taken from the column CustomEventTypeID  in the ThoughtFarmer table CustomEventTypeLocalized 

Parameters for 'MailingList' page type:
Parameter Type Description
mailingListEmail string
Required. Email address for the mailing list.


Response Status Codes:
200 Success
400 Validation failed
403 Insufficient permissions
404 Page not found
501 Page type unsupported


Example request
PATCH http://yourserver.com/api/content/{id}
  Authorization: {token}
Content-Type: application/json
{
    "title": "Updated title",
    "body": "Updated body",
    "culture": "en",
    "pageType": "Section",
    "isPublished": true
}
{
    "body": [
        {
            "key": "en",
            "value": ""
        }
    ],
    "allowFiles": true,
    "layout": 8,
    "pageType": "Calendar",
    "grandParentId": 0,
    "abbreviatedTitle": [
        {
            "key": "en",
            "value": ""
        }
    ],
    "contentId": 10874,
    "summary": [
        {
            "key": "en",
            "value": ""
        }
    ],
    "creatorId": 189,
    "dateModified": "2016-03-01T23:05:22.29",
    "datePosted": "2016-03-01T01:32:48.27",
    "datePublished": "2016-03-01T01:32:48.27",
    "modifiedId": 189,
    "ownerId": 189,
    "parentId": 1073,
    "title": [
        {
            "key": "en",
            "value": "Updating the title"
        }
    ],
    "treePath": "<a href=\"http://localhost:3000/\">Home</a>  <a href=\"http://localhost:3000/people/\">Find Person</a>  <a href=\"http://localhost:3000/content/1073\">Mr. Testeroonie Person</a>  <a href=\"http://localhost:3000/content/10874\" id=\"pageTitle\">Updating the title</a>",
    "treePathText": "Home &rsaquo; Find Person &rsaquo; Mr. Testeroonie Person &rsaquo; Updating the title",
    "lastModifiedBy": "Updated <abbr class=\"timeago\" title=\"2016-03-01T23:05:22Z\">just now</abbr> by <a href=\"http://localhost:3000/content/1073\" title=\"Mr. Testeroonie Person\">Mr. Testeroonie Person</a>",
    "permissionIsEdit": true,
    "permissionIsView": true,
    "isPublished": true
}