Description
When creating an Experiment using the 'POST /entities' API, it's crucial to know which fields of the Experiment Template are required. Omitting a required parameter value or including a value to a field with an auto-generated value in the request will result in a 400 error.
Solution
To determine the required fields, follow these steps:
- Call the 'GET /entities/templates/{eid}/fields' API
Replace {eid} with the Entity ID of the Experiment Template - Analyze the API response, which provides the following key information:
a. Name field auto-generation:
- Check if the "Name" attribute has a type of "auto".
- If so, do not include a "name" value in the Experiment creation request.
b. Required fields:
- Look for attributes with an "isRequired" flag set to true in their "meta" object.
- Include values for all required fields in the Experiment creation request.
By following these steps, you can ensure that your API request includes all necessary information, avoiding 400 errors when creating an Experiment from a template.