getPostBySlug( )

Gets a post by the provided slug.

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

The slug is the end of a post's URL that refers to a specific post. For example, if a post's URL is https:/example.com/blog/post/my-post-slug, the slug is my-post-slug. The slug is case-sensitive, and is generally derived from the post title, unless specified otherwise.

Permissions
Read Blog
Manage Blog
Read Draft Blog Posts
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
slugstringRequired

Slug of the post to retrieve.

The end of a post's URL, for example, https:/example.com/blog/post/my-post-slug. Case sensitive and generally based on the post title if not specified.


optionsGetPostBySlugOptions

Options specifying which fields to return.

Returns
Return Type:Promise<GetPostBySlugResponse>
Was this helpful?
Yes
No