Description
API call to restore deleted segments
-
Requires write access to the site group, the same access that allows deleting segments there. Without it the call fails with
Permission deniedand nothing is restored. -
Internal segments and segments in a standard group can be restored only by admins.
-
All the segment ids should be from one site group. A segment id that does not belong to the site group is reported the same way as an unknown id:
No restorable segment [<id>] found in site group [<siteGroupId>]. Skipped. -
Only segments deleted no more than 90 days ago can be restored.
Request
The request object has the following fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
Array Of String |
Yes |
All the segment ids need to be restored |
|
|
String |
Yes |
The site group identifier of restorable segments |
Response
The call answers 200 whatever happened to each segment. Read restoredIds to see which segments came back.
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Array of String |
The segments that were restored. |
|
|
Object |
The segments that were not restored and why, by segment id: for example, a segment it uses is still deleted. |
|
|
Object |
The segments whose restore was attempted and failed, by segment id, with the error. |
|
|
Array of String |
The same outcome in words: successfully restored, skipped, failed. |
Examples
$ python cx.py /segment/restore '{"siteGroupId":"10501", "segmentIds": ["1y2hkqwvv58ls", "1y2hkqwvv58ln", "1y2hkqwvv58lp"]}'
{
"messages": [
"Segments successfully restored: [1y2hkqwvv58ls]",
"Restore failed for segment: 1y2hkqwvv58ln. Error message",
"No restorable segment [1y2hkqwvv58lp] found in site group [10501]. Skipped"
],
"restoredIds": ["1y2hkqwvv58ls"],
"skipped": {
"1y2hkqwvv58lp": "No restorable segment [1y2hkqwvv58lp] found in site group [10501]. Skipped"
},
"failed": {
"1y2hkqwvv58ln": "Error message"
}
}