Update Page Draft
POST
/merchants/{merchantCode}/shops/{shopCode}/pages/{pageCode}
const url = 'https://cms.shopgate.io/v1/merchants/example/shops/example/pages/example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","pageTitle":{"en-us":"string in english","de-de":"Zeichenkette auf Deutsch"},"slug":"example","type":"cms","isFavorite":false,"isProtected":false,"dropzones":{"cmsWidgetList":[{"code":"8b2802a6-ab0e-4310-97d4-096ae8b3610f","widgetConfigDefinitionCode":"8b2802a6-ab0e-4310-97d4-096ae8b3610f","widgetConfig":{},"visibility":{"isHidden":false,"scheduleStartDate":"2018-12-12T14:27:23.114Z","scheduleEndDate":"2018-12-12T14:27:23.114Z"},"layout":{"marginTop":1,"marginBottom":1,"marginLeft":1,"marginRight":1}}]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://cms.shopgate.io/v1/merchants/example/shops/example/pages/example \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "pageTitle": { "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch" }, "slug": "example", "type": "cms", "isFavorite": false, "isProtected": false, "dropzones": { "cmsWidgetList": [ { "code": "8b2802a6-ab0e-4310-97d4-096ae8b3610f", "widgetConfigDefinitionCode": "8b2802a6-ab0e-4310-97d4-096ae8b3610f", "widgetConfig": {}, "visibility": { "isHidden": false, "scheduleStartDate": "2018-12-12T14:27:23.114Z", "scheduleEndDate": "2018-12-12T14:27:23.114Z" }, "layout": { "marginTop": 1, "marginBottom": 1, "marginLeft": 1, "marginRight": 1 } } ] } }'Updates the current page draft. Does not affect the live site until published.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”merchantCode
required
string
shopCode
required
string
pageCode
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
name
string
pageTitle
Localization object, see Entity Localization for further information.
object
key
additional properties
null | string
Example
{ "en-us": "string in english", "de-de": "Zeichenkette auf Deutsch"}slug
string
type
string
isFavorite
boolean
isProtected
boolean
dropzones
object
cmsWidgetList
Array<object>
object
code
required
Code of the entity
string
Example
8b2802a6-ab0e-4310-97d4-096ae8b3610fwidgetConfigDefinitionCode
required
Code of the entity
string
Example
8b2802a6-ab0e-4310-97d4-096ae8b3610fwidgetConfig
required
object
key
additional properties
any
visibility
required
object
isHidden
boolean
scheduleStartDate
required
null | string format: date-time
Example
2018-12-12T14:27:23.114ZscheduleEndDate
required
null | string format: date-time
Example
2018-12-12T14:27:23.114Zlayout
required
object
marginTop
required
number | null
marginBottom
required
number | null
marginLeft
required
number | null
marginRight
required
number | null
Responses
Section titled “Responses”Update next page response
Media typeapplication/json
Validation error
Media typeapplication/json
object
statusCode
number
message
string
code
string
additionalInfo
object
validationErrors
Array<object>
object
code
number
reason
string
entity
string
entityId
string
subentityPath
Array<string | number>
error
object
paramName
The parameter-field, that failed to validate, like “userId”
string
paramValue
The value, that was sent, like “xxx”
null | string | number | array | object
code
Machine readable error code
string
message
required
Human readable error code
string
results
object
errors
Array<object>
object
code
Machine readable error code
string
message
Human readable error code
string
description
string
path
Array<string>
warnings
array
Example
{ "error": { "code": "SCHEMA_VALIDATION_FAILED", "results": { "errors": [ { "code": "MAX_LENGTH", "message": "Name too long", "description": "Property Name is too long", "path": [ "name" ] } ] } }}Resource not found
Media typeapplication/json
object
statusCode
number
code
required
string
message
required
string
Example
{ "code": "NotFound", "message": "Merchant not found"}
