> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: listDeletedDraftPosts(options: ListDeletedDraftPostsOptions) # Method package: wixBlogBackend # Method menu location: wixBlogBackend --> draftPosts --> listDeletedDraftPosts # Method Link: https://dev.wix.com/docs/velo/apis/wix-blog-backend/draft-posts/list-deleted-draft-posts.md # Method Description: Retrieves a list of up to 100 deleted draft posts. List Deleted Draft Posts runs with these defaults, which you can override: - `editedDate` is sorted in descending order. In this case,`editedDate` implies the date the post was deleted. - `paging.limit` is `50`. - `paging.offset` is `0`. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## List deleted draft posts (dashboard page code) ```javascript import { draftPosts } from 'wix-blog-backend'; export async function myListDeletedDraftPostFunction() { try { const deletedDraftPost = await draftPosts.listDeletedDraftPosts(); console.log('Successfully retrieved the following deleted draft posts:', deletedDraftPost); return deletedDraftPost; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "draftPosts": [ * { * "_id": "425a5dca-c32d-40e6-b2d7-a8ffa3addded", * "_createdDate": "2023-08-13T13:51:23.823Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "65af9595676f8c78e7e808e7", * "coverMedia": { * "custom": false, * "displayed": true, * "enabled": true, * "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773" * }, * "editedDate": "2024-01-23T10:31:49.017Z", * "featured": false, * "firstPublishedDate": "2023-03-22T14:16:01.200Z", * "hashtags": [ * "vacation", * "dream", * "summer", * "hashtag" * ], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 2, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "tags": [] * }, * "seoSlug": "when-expecting-expect-the-unexpected", * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "When expecting, expect the unexpected", * "translations": [] * }, * { * "_id": "2b36fbd0-f87a-43ce-ad11-e73d354b0072", * "_createdDate": "2024-01-08T16:16:29.630Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "659c2017e7b862a68364f0bd", * "editedDate": "2024-01-08T16:21:30.639Z", * "editingSessionId": "760338e1-3e8d-4377-8aa4-cebf0763827f", * "featured": false, * "hashtags": [], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/nsplsh_e24d88fb732446e48d71951b09c571e8~mv2.jpg/a%20man%20with%20a%20lot%20of%20tattoos%20on%20his%20chest.jpg#originWidth=3818&originHeight=4772" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 1, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "settings": { * "keywords": [], * "preventAutoRedirect": false * }, * "tags": [] * }, * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "When we stand together", * "translations": [] * }, * { * "_id": "66935097-31c5-4fab-9693-aa1b53aeea77", * "_createdDate": "2024-01-07T08:39:26.900Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "659a6364bb866d6c2d674b4d", * "coverMedia": { * "custom": false, * "displayed": true, * "enabled": true, * "image": "wix:image://v1/11062b_9874b9821b9a4c92a07b1349883fbc42~mv2_d_3000_4507_s_4_2.jpg#originWidth=3000&originHeight=4507" * }, * "editedDate": "2024-01-07T08:40:08.655Z", * "editingSessionId": "1a140780-9d07-4d18-b914-a6d69c313879", * "featured": false, * "hashtags": [], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/11062b_9874b9821b9a4c92a07b1349883fbc42~mv2_d_3000_4507_s_4_2.jpg#originWidth=3000&originHeight=4507" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 1, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "tags": [] * }, * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "This is a draft", * "translations": [] * } * ], * "metaData": { * "count": 3, * "offset": 0, * "total": 3 * } * } */ ``` ## List deleted draft posts using options (export from backend code) ```javascript import { draftPosts } from 'wix-blog-backend'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; /* * Sample options value: * { * draftPostIds: ["425a5dca-c32d-40e6-b2d7-a8ffa3addded", "5fb8b42a-42e1-4c77-92e7-46d93cf4ad0b"], * fieldsets: ["GENERATED_EXCERPT"], * language: "en", * paging: { * cursor: "", * limit: 2, * offset: 0 * }, * sort: "EDITING_DATE_ASC" * } */ const elevatedListDraftPost = elevate(draftPosts.listDraftPosts); export const myListDeletedDraftPostFunction = webMethod( Permissions.Admin, async (options) => { try { const deletedDraftPost = await elevatedListDraftPost(options); console.log('Successfully retrieved the following deleted draft posts:', deletedDraftPost); return deletedDraftPost; } catch (error) { console.error(error); // Handle the error } } ); /* Promise resolves to: * { * "draftPosts": [ * { * "_id": "66935097-31c5-4fab-9693-aa1b53aeea77", * "_createdDate": "2024-01-07T08:39:26.900Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "659a6364bb866d6c2d674b4d", * "coverMedia": { * "custom": false, * "displayed": true, * "enabled": true, * "image": "wix:image://v1/11062b_9874b9821b9a4c92a07b1349883fbc42~mv2_d_3000_4507_s_4_2.jpg#originWidth=3000&originHeight=4507" * }, * "editedDate": "2024-01-07T08:40:08.655Z", * "editingSessionId": "1a140780-9d07-4d18-b914-a6d69c313879", * "excerpt": "Testing the DraftPosts API", * "featured": false, * "hashtags": [], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/11062b_9874b9821b9a4c92a07b1349883fbc42~mv2_d_3000_4507_s_4_2.jpg#originWidth=3000&originHeight=4507" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 1, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "tags": [] * }, * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "This is a draft", * "translations": [] * }, * { * "_id": "2b36fbd0-f87a-43ce-ad11-e73d354b0072", * "_createdDate": "2024-01-08T16:16:29.630Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "659c2017e7b862a68364f0bd", * "editedDate": "2024-01-08T16:21:30.639Z", * "editingSessionId": "760338e1-3e8d-4377-8aa4-cebf0763827f", * "excerpt": "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled...", * "featured": false, * "hashtags": [], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/nsplsh_e24d88fb732446e48d71951b09c571e8~mv2.jpg/a%20man%20with%20a%20lot%20of%20tattoos%20on%20his%20chest.jpg#originWidth=3818&originHeight=4772" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 1, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "settings": { * "keywords": [], * "preventAutoRedirect": false * }, * "tags": [] * }, * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "When we stand together", * "translations": [] * } * ], * "metaData": { * "count": 2, * "offset": 0, * "total": 3 * } * } */ ``` ## List deleted draft posts (export from backend code) ```javascript import { draftPosts } from 'wix-blog-backend'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedListDeletedDraftPost = elevate(draftPosts.listDeletedDraftPosts); export const myListDeletedDraftPostFunction = webMethod( Permissions.Admin, async () => { try { const deletedDraftPost = await elevatedListDeletedDraftPost(); console.log('Successfully retrieved the following deleted draft posts:', deletedDraftPost); return deletedDraftPost; } catch (error) { console.error(error); // Handle the error } } ); /* Promise resolves to: * { * "draftPosts": [ * { * "_id": "425a5dca-c32d-40e6-b2d7-a8ffa3addded", * "_createdDate": "2023-08-13T13:51:23.823Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "65af9595676f8c78e7e808e7", * "coverMedia": { * "custom": false, * "displayed": true, * "enabled": true, * "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773" * }, * "editedDate": "2024-01-23T10:31:49.017Z", * "featured": false, * "firstPublishedDate": "2023-03-22T14:16:01.200Z", * "hashtags": [ * "vacation", * "dream", * "summer", * "hashtag" * ], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/75059a_9f8cd2f1282c4dc7ae9a4bea155e2661~mv2.jpg#originWidth=602&originHeight=773" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 2, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "tags": [] * }, * "seoSlug": "when-expecting-expect-the-unexpected", * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "When expecting, expect the unexpected", * "translations": [] * }, * { * "_id": "2b36fbd0-f87a-43ce-ad11-e73d354b0072", * "_createdDate": "2024-01-08T16:16:29.630Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "659c2017e7b862a68364f0bd", * "editedDate": "2024-01-08T16:21:30.639Z", * "editingSessionId": "760338e1-3e8d-4377-8aa4-cebf0763827f", * "featured": false, * "hashtags": [], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/nsplsh_e24d88fb732446e48d71951b09c571e8~mv2.jpg/a%20man%20with%20a%20lot%20of%20tattoos%20on%20his%20chest.jpg#originWidth=3818&originHeight=4772" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 1, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "settings": { * "keywords": [], * "preventAutoRedirect": false * }, * "tags": [] * }, * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "When we stand together", * "translations": [] * }, * { * "_id": "66935097-31c5-4fab-9693-aa1b53aeea77", * "_createdDate": "2024-01-07T08:39:26.900Z", * "categoryIds": [], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "659a6364bb866d6c2d674b4d", * "coverMedia": { * "custom": false, * "displayed": true, * "enabled": true, * "image": "wix:image://v1/11062b_9874b9821b9a4c92a07b1349883fbc42~mv2_d_3000_4507_s_4_2.jpg#originWidth=3000&originHeight=4507" * }, * "editedDate": "2024-01-07T08:40:08.655Z", * "editingSessionId": "1a140780-9d07-4d18-b914-a6d69c313879", * "featured": false, * "hashtags": [], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/11062b_9874b9821b9a4c92a07b1349883fbc42~mv2_d_3000_4507_s_4_2.jpg#originWidth=3000&originHeight=4507" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 1, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "tags": [] * }, * "slugs": [], * "status": "DELETED", * "tagIds": [], * "title": "This is a draft", * "translations": [] * } * ], * "metaData": { * "count": 3, * "offset": 0, * "total": 3 * } * } */ ``` ---