Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contentful API Not Returning Entry Status (Published/Draft) for Variants #2360

Open
nadeemtuvoc opened this issue Oct 17, 2024 · 0 comments
Open

Comments

@nadeemtuvoc
Copy link

nadeemtuvoc commented Oct 17, 2024

I'm using the Contentful Preview API to fetch entries of content type variant with the following code:

export const previewClient = createClient({
    space: process.env.CONTENTFUL_SPACE_ID!,
    accessToken: process.env.CONTENTFUL_PREVIEW_ACCESS_TOKEN!,
    host: "preview.contentful.com",
    environment: process.env.CONTENTFUL_ENVIRONMENT,
});

const response = await previewClient.getEntries({
    content_type: "variant",
    "fields.gemistProductId[in]": productIds.join(","),
});

Issue:
The API response does not include sys.publishedAt. So, I am not able to identify entries are in a published or draft state. I would like to retrieve this status as part of the entry details.

Questions:
How can I identify the published or draft status for the entries using the Preview API?
Is there any additional configuration required to access this information?

I am using "contentful": "^10.15.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant