Rest API
Restore a content library change
POST
/api/v1/wiki/change-log/{id}/restore
const url = 'https://api.unless.com/api/v1/wiki/change-log/1/restore';const options = { method: 'POST', headers: { 'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example', 'x-website-id': 'example', 'Content-Type': 'application/json' }, body: '{"target":"before"}'};
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://api.unless.com/api/v1/wiki/change-log/1/restore \ --header 'Content-Type: application/json' \ --header 'x-account-id: example' \ --header 'x-api-key: example' \ --header 'x-user-email: example' \ --header 'x-website-id: example' \ --data '{ "target": "before" }'Roll a page back to one side of a logged change.
Notes
targetpicks which snapshot to write back:beforeundoes the change,afterre-applies it. Anything other thanafteris treated asbefore- The restore is itself recorded in the change log
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
Numeric change-log entry id.
Header Parameters
Section titled “Header Parameters”x-api-key
required
string
Your API key from account settings.
x-user-email
required
string
The email address of your user.
x-account-id
required
string
The ID of your account. You can find this in the account settings.
x-website-id
required
string
The ID of the workspace you want to use.
Request Body
Section titled “Request Body”Media typeapplication/json
object
target
string
Example
{ "target": "before"}Responses
Section titled “Responses”The change was restored.
Media typeapplication/json
object
id
integer
restored
boolean
Example generated
{ "id": 1, "restored": true}Unauthorized - invalid API key.
Bad request - missing websiteId, or an invalid change-log id.