Documentation

API /content/{contentId}/update

ThoughtFarmer REST API Method: /content/{contentId}/update

Updates content in ThoughtFarmer. Returns the updated content when successful. Will only updated the optional parameters supplied, not all parameters need to be a part of the call.

URL:
http://yourserver.com/api/content/{contentId}/update

http://yourserver.com/api/2.0/content/{contentId}/update


Response Formats:
xml,json

HTTP Method(s):
PUT

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

Parameters:

Parameter Type Description
contentId 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
layout string
Required if the pageType is changed.
LeftNavigation - For pageType Page
CompactDirectory, NavigationTwoColumn, NavigationOneColumn, Thumbnail - For pageType Section or Group
Day, Week, Month - For pageType CalendarEvent
News, Blog - For pageType NewsBlog
None - For all other pageType values
isPublished bool true, false. False will set the page to be Private.
token string Required. A valid token authentication parameter

Optional parameters for just CalendarEvent 
Parameter Type Description
startDate string
Required. 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 


Response Status Codes:
200 - Update successful
401 - Token parameter is invalid
403 - No permissions to make update
404 - Content not found
500 - Any parameter validation error.

Example request
POST http://yourserver.com/api/content/{contentId}/update
POST Data title={title}&body={body}&culture={culture}&pageType={pageType}&layout={layout}&isPublished={isPublished}&token={token}
{
   "AbbreviatedTitle":[
      {
         "Key":"en",
         "Value":""
      }
   ],
   "ContentId":42750,
   "CreatorId":99,
   "DateModified":"\/Date(1351560561623-0700)\/",
   "DatePosted":"\/Date(1351560561623-0700)\/",
   "DatePublished":"\/Date(1351560561623-0700)\/",
   "GrandParentId":0,
   "IsPublished":true,
   "LastModifiedBy":"...",
   "Layout":2,
   "ModifiedId":99,
   "OwnerId":99,
   "PageType":1,
   "ParentId":11800,
   "PermissionIsEdit":true,
   "PermissionIsView":true,
   "Summary":[
      {
         "Key":"en",
         "Value":""
      }
   ],
   "Title":[
      {
         "Key":"en",
         "Value":"Page Title"
      }
   ],
   "TreePath":"...",
   "TreePathText":"Directory  People  David Root, Product Marketing  Page Title",
   "Body":"Page Body"
}