Is there any way to load JSON file to Contentful’s space?
Hi @sumati.jain ,
Depending how many JSON files you would need to upload, you have two ways:
-
Adapt your JSON structure to the import/export structure, and then use our CLI import tool: Importing and exporting content with the Contentful CLI | Contentful
-
Or, as I recommended in a previous post, use CMA API (with any language/SDK you want) to build your custom importer: Contentful CLI Importer help
Thanks Alma for response! It’s very helpful.
When I’m using CLI to load Json data into Contentful, then command went through but no entries going to contentful.
I think, content type is not mentioned in the command, could be the problem. I’m new to Contentful So, not sure what could be the reason.
Please let me know if there is any issue with command.
Command
Hi @sumati.jain ,
Sorry to hear it didn’t work. The reason is probably because the data structure in import has to match the same as in the export. I would recommend to:
- Export the data of a Contentful test-space using the CLI export
- Inspect the created JSON:
- You should have the Content-types for entries you will create
- The JSON of your content should match the Contentful one
- Then you could try to use the importing tool
If this is too complicated, maybe it would be better to use a simple script (using our Management API) that:
- reads your JSON
- creates the content-type in Contentful
- create the entry in Contentful
Hi mam,Very useful for this document mam,I’ll have one doubt how to convert contentful content to JSON file