> 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: getDeletedDraftPost(draftPostId: string) # Method package: wixBlogBackend # Method menu location: wixBlogBackend --> draftPosts --> getDeletedDraftPost # Method Link: https://dev.wix.com/docs/velo/apis/wix-blog-backend/draft-posts/get-deleted-draft-post.md # Method Description: Gets a deleted draft post from the trash bin by the provided ID. Uses the provided `draftPostId` to retrieve a previously deleted draft post from the trash bin. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get a deleted draft post from the trash bin (export from backend code) ```javascript import { draftPosts } from 'wix-blog-backend'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; // Sample draftPostId value: "26a7c0e49-036b-4874-b4cd-e015a22e857c" const elevatedGetDeletedDraftPost = elevate(draftPosts.getDeleteDraftPost); export const myGetDeletedDraftPostFunction = webMethod( Permissions.Admin, async (draftPostId) => { try { const deletedDraftPost = await elevatedGetDeletedDraftPost(draftPostId); console.log('Successfully deleted the following draft post:', deletedDraftPost); return deletedDraftPost; } catch (error) { console.error(error); // Handle the error } } ); /* Promise resolves to: * { * "draftPost": { * "_id": "6a7c0e49-036b-4874-b4cd-e015a22e857c", * "_createdDate": "2023-08-13T13:51:23.823Z", * "categoryIds": [ * "c8780752-f517-4cf9-9c18-0f9a22d00926", * "590635d7-cc7c-48cb-970c-f8339daa1cfe" * ], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "65a642ad69a6e0d73c4ae0b6", * "editedDate": "2024-01-16T08:47:56.900Z", * "featured": false, * "firstPublishedDate": "2023-03-22T14:16:01.202Z", * "hashtags": [ * "vacation", * "dream", * "summer", * "hashtag" * ], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/a27d24_77c3bdd084c14f50a13aa9b44485c2e3~mv2.jpg/a27d24_11a0749276464a5faf356d2a8e73b842~mv2.jpg#originWidth=1868&originHeight=2612" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 2, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "settings": { * "keywords": [], * "preventAutoRedirect": false * }, * "tags": [] * }, * "seoSlug": "how-decluttering-changed-my-life", * "slugs": [], * "status": "DELETED", * "tagIds": [ * "a55b2c06-cbec-4d01-a8bb-cd7029056c75", * "d2b0c02b-72c1-45af-ba58-3520cec9abe3" * ], * "title": "How decluttering changed my life", * "translations": [] * } * } */ ``` ## Get a deleted draft post from the trash bin (dashboard page code) ```javascript import { draftPosts } from 'wix-blog-backend'; // Sample draftPostId value: "26a7c0e49-036b-4874-b4cd-e015a22e857c" export async function myGetDeletedDraftPostFunction(draftPostId) { try { const deletedDraftPost = await draftPosts.getDeleteDraftPost(draftPostId); console.log('Successfully deleted the following draft post:', deletedDraftPost); return deletedDraftPost; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "draftPost": { * "_id": "6a7c0e49-036b-4874-b4cd-e015a22e857c", * "_createdDate": "2023-08-13T13:51:23.823Z", * "categoryIds": [ * "c8780752-f517-4cf9-9c18-0f9a22d00926", * "590635d7-cc7c-48cb-970c-f8339daa1cfe" * ], * "changeOrigin": "MOVE_TO_TRASH", * "commentingEnabled": true, * "contentId": "65a642ad69a6e0d73c4ae0b6", * "editedDate": "2024-01-16T08:47:56.900Z", * "featured": false, * "firstPublishedDate": "2023-03-22T14:16:01.202Z", * "hashtags": [ * "vacation", * "dream", * "summer", * "hashtag" * ], * "hasUnpublishedChanges": true, * "language": "en", * "media": { * "custom": false, * "displayed": true, * "wixMedia": { * "image": "wix:image://v1/a27d24_77c3bdd084c14f50a13aa9b44485c2e3~mv2.jpg/a27d24_11a0749276464a5faf356d2a8e73b842~mv2.jpg#originWidth=1868&originHeight=2612" * } * }, * "memberId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "minutesToRead": 2, * "mostRecentContributorId": "c00e8a5c-322b-4e77-8813-002e3ea7e811", * "pricingPlanIds": [], * "relatedPostIds": [], * "seoData": { * "settings": { * "keywords": [], * "preventAutoRedirect": false * }, * "tags": [] * }, * "seoSlug": "how-decluttering-changed-my-life", * "slugs": [], * "status": "DELETED", * "tagIds": [ * "a55b2c06-cbec-4d01-a8bb-cd7029056c75", * "d2b0c02b-72c1-45af-ba58-3520cec9abe3" * ], * "title": "How decluttering changed my life", * "translations": [] * } * } */ ``` ---