getCategory( )


Gets a category by the specified ID.

The getCategory() function returns a Promise that resolves to a category whose ID matches the specified ID.

Permissions
Manage Blog
Read Blog
Read Draft Blog Posts
Learn more about app permissions.
Method Declaration
Copy
function getCategory(
  categoryId: string,
  options: GetCategoryOptions,
): Promise<GetCategoryResponse>;
Method Parameters
categoryIdstringRequired

Category ID.


optionsGetCategoryOptions

Options specifying which fields to return.

Returns
Return Type:Promise<GetCategoryResponse>
JavaScript
import { categories } from "@wix/blog"; async function getCategory(categoryId, options) { const response = await categories.getCategory(categoryId, options); }
Errors

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

Did this help?