getPost( )


Gets a post by the specified ID.

The getPost() function returns a Promise that resolves to a post whose ID matches the given ID.

Permissions
Manage Blog
Read Blog
Read Draft Blog Posts
Learn more about app permissions.
Method Declaration
Copy
function getPost(
  postId: string,
  options: GetPostOptions,
): Promise<GetPostResponse>;
Method Parameters
postIdstringRequired

Post ID.


optionsGetPostOptions

Options specifying which fields to return.

Returns
Return Type:Promise<GetPostResponse>
JavaScript
import { posts } from "@wix/blog"; async function getPost(postId, options) { const response = await posts.getPost(postId, options); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?