Rest API
Accept, deny or retry one staged content library change
PATCH
/api/v1/wiki/tasks/{taskId}/changes/{changeId}
const url = 'https://api.unless.com/api/v1/wiki/tasks/example/changes/example';const options = { method: 'PATCH', headers: { 'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example', 'x-website-id': 'example', 'Content-Type': 'application/json' }, body: '{"action":"accept"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.unless.com/api/v1/wiki/tasks/example/changes/example \ --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 '{ "action": "accept" }'Act on a single change inside a content library suggestion task.
Notes
acceptwrites the change to the library,denydiscards it,retryre-runs a change that failed to applyacceptanddenyanswer200with the task’s new state.retryanswers202, because it runs asynchronously
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”taskId
required
string
changeId
required
string
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 Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
action
required
string
Example
{ "action": "accept"}Responses
Section titled “Responses”The change was accepted or denied.
Media typeapplication/json
object
changeId
string
changeStatus
string
taskState
string
Example
{ "changeStatus": "accepted"}A retry was started.
Media typeapplication/json
object
changeId
string
changeStatus
string
Example
{ "changeStatus": "retrying"}Unauthorized - invalid API key.
Bad request - missing ids, an invalid action, or the task is not a content library suggestion.