WS: CMS - Preset Content Create

WS: CMS - Preset Content Create

Indice

Request

http://www.virtualcms.it/webservices/preset/create.jsp?parameters

You need to replace http://www.virtualcms.it/ with the URL of the webCMS instance.

Response

{
   "internalId":178877,
   "status":"OK"
}

If something went wrong the status "KO" will be prompted.

internalId is the id generated by the VirtualCms platform. It could be used for future matchings so it's a good idea to store it.

Parameters

PARAMETER NAME MANDATORY VALUE FORMAT DESCRIPTION
presetId Y number
title Y string
authCode Y string must contains title+security code provided by Virtualcom, authcode needs to be provided using md5.
pretitle N string
subtitle N string
summary N string
image N string Link of the resource ex. http://www.virtualcms.it/image.jpg
text N string
keywords Y string
author N string
expirationDate N date Date format yyyy-MM-dd HH:mm:ss
customLink N string customLink for the article (absolute url)

In addition you need to pass all the fields required by the preset you chose to create.

To retrieve the list of fields you can call the following webservice: http://www.virtualcms.it/webservices/preset/getFields.jsp?presetId=$id

Example

Response of the getFields Webservice

{
   "status":"OK",
   "fields":[
      {
         "id":11,
         "values":[
            "Arts",
            "Comedy",
            "Community",
            "Gigs",
            "Music",
            "Theatre",
            "Other"
         ],
         "mandatory":true,
         "name":"Category",
         "type":"string"
      },
      {
         "id":12,
         "mandatory":true,
         "name":"Start",
         "type":"date"
      },
      {
         "id":13,
         "mandatory":true,
         "name":"End",
         "type":"date"
      },
      {
         "id":15,
         "mandatory":false,
         "name":"Price",
         "type":"currency"
      },
      {
         "id":16,
         "mandatory":false,
         "name":"Link",
         "type":"link"
      }
   ]
}

Example request

Post

http://www.virtualcms.it/webservices/preset/create.jsp?presetId=1&title=Title&authCode=1e56ce6ac21a3b72d3c20e5fad4bcf9e&field[11]=Music&field[12]=2015-01-01%2020%3A00%3A00&field[13]=2015-01-10%2008%3A00%3A00&field[15]=25.99&field[16]=http%3A%2F%2Fwww.virtualcms.it

Every fields is passed with the following syntax: field[id]=value.

Replace id with the id returned on the previous webservices

Fields types

Type Description Example
string Sequence of characters Lorem ipsum dolor sit amet
date Date format yyyy-MM-dd HH:mm:ss 2010-12-01 15:30:00
number, currency Any digits. To separate the integer part from the fractional part use the point (.) symbol 9.99
link Website URL http://www.virtualcms.it
email example@virtualcom.it