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

Getting 404 error getEnvironments method #1838

Closed
itsppal02 opened this issue May 24, 2023 · 3 comments
Closed

Getting 404 error getEnvironments method #1838

itsppal02 opened this issue May 24, 2023 · 3 comments

Comments

@itsppal02
Copy link

I am trying to access environments of space but getting error
image
I already allowed all enviourments in API token but still getting error
image
This are associated Environments of my space
image
This is code

import * as contentful from 'contentful-management';
const client = contentful.createClient({
    accessToken: TOKEN,
    host: 'cdn.contentful.com',
});
const main = async () => {
    const space = await client.getSpace(SPACE_ID);
    const env = await space.getEnvironments();
}
main();

Please help me on that error

@rahulaakaram13
Copy link

rahulaakaram13 commented May 24, 2023

+1

Same open Issue: #1839

@RobertMrowiec
Copy link

@itsppal02 @rahulaakaram13 are you sure, you've used TOKEN from CMA Personal Tokens, not just Contentful Access Token?

image

@Vinz93
Copy link
Contributor

Vinz93 commented Oct 24, 2023

@itsppal02 if you need to fetch the environments you should use the contentful-management API (CMA) with your cma-token not the API key used for the Delivery API, please make sure that your token is not compromised since its bound to your account, with the same permissions across your spaces and organizations.

Similar question for reference #1839

I'm closing this ticket for now, but feel free to reach out again
if you have more questions.

Best
Vincenzo

@Vinz93 Vinz93 closed this as completed Oct 24, 2023
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

4 participants