Create case

Creates a new case based on the information provided

Recipes
💼
Create a Case
Open Recipe

Returns: a json object with meta data for the created case

:param int case_type: the type of case you want to make, '0 = custom design' -- '1 = simulation' -- '2 = standard design'
:param string name: the name you want to give to the case
:param int project_Id: the id of the project that you want this case to be a part of

def create_case(self, case_type, name, project_Id) -> Dict:

    cases_url = self.caseserver_url + "/cases"
    payload = json.dumps({"type": case_type, "name": name, "projectId": project_Id})
    
    response = requests.post(cases_url, data=payload, headers=self.put_header)
    if(response.ok): 
        print("case creation successful: \n", response.text, "\n")
        return response.json()
    else: 
        logger.error(f"case creation failed: {response.content}")
        raise Exception
Language
Credentials
Header
Click Try It! to start a request and see the response here!