Create content on an existing custom type using rest API or a graphql mutation

With my team we are migrating to Slice machine but we have 3000 documents that we need to migrate manually. Is there a way to create this content using a Graphql mutation or the REST API?

Thanks for the help

Hi @manuelo

Thanks for reaching out.

Neither the REST API nor the GraphQL API has a write endpoint, so currently, we don't recommend migrating the legacy projects to Slice Machine, you can check this thread for more about the current situation.

aphQL mutation, depending on the technology stack and APIs you are using. Here's a general overview of how to create content using both approaches:

Using REST API:

  1. Endpoint: Identify the endpoint (URL) for creating content on the existing custom type. This endpoint should be designed to handle HTTP POST requests.
  2. Request Payload: Construct the request payload in the required format, typically JSON. The payload should include the necessary data fields for the new content item.
  3. Authentication: Ensure you have the necessary authentication tokens or credentials to authenticate the request. Include the authentication details in the request headers www. bloxfruitsscripts.com.
  4. Send POST Request: Use a HTTP library (e.g., axios in JavaScript) to send a POST request to the endpoint, including the payload and authentication headers.