The /api/solutions endpoint is used to queue up calculations in our servers.

Request Format

curl api-token:{INSERT_API_KEY_HERE}https://app.clearcalcs.com/api/solutions \
  -h "Content-Type: application/json" \
  -d '{"data": {"attributes": {"calculations": [ INSERT_CALCULATION_OBJECTS_HERE ]}}}'

Request Body

{
    "data": {
        "attributes": {
            "calculations": [] // Array of calculation objects (up to 200)
        }
    }
}

Each calculation object should follow the schema specified at the $module URL. Below is a sample calculation object for an Australian Truss Analysis Wizard calculation:

{
    // This URL is also a JSON Schema detailing available inputs and outputs.
    "$module": "https://app.clearcalcs.com/api/schemas/modules/AU/trussAnalysis/v1.json",

    // Your internal identifier for this calculation.
    "$id": "RT1",

    // Display name if calculation is viewed within the ClearCalcs platform. Can be the same as `$id`.
    "$name": "RT1",

    // See `#input` definition in the `$module` JSON Schema for available inputs.

    // Use custom type, as we'll be specifying all the nodes and elements manually
    "type_assembly": "Custom Truss",

    // Member types used by element definitions
    "material": "CFS",
    // Top Chord Member (member type 0)
    "MemberT_cfs_AUNZ": "C300-24 (Lysaght®)",
    // Webs Member (member type 1)
    "MemberW_cfs_AUNZ": "C300-24 (Lysaght®)",
    // Bottom Chord Member (member type 2)
    "MemberB_cfs_AUNZ": "C300-24 (Lysaght®)",

    // Nodes in truss
    "nodes_custom": [
        {"X": 0, "Y": 0},
        {"X": 3000, "Y": 0},
        {"X": 6000, "Y": 0},
        {"X": 1500, "Y": 3000},
        {"X": 4500, "Y": 3000},
    ],

    // Elements in truss, between nodes above
    "elements_custom": [
        {"member_type_num": 2, "start_node_num": 0, "end_node_num": 1, "start_conn": "Fixed", "end_conn": "Fixed"},
        {"member_type_num": 2, "start_node_num": 1, "end_node_num": 2, "start_conn": "Fixed", "end_conn": "Fixed"},
        {"member_type_num": 1, "start_node_num": 0, "end_node_num": 3, "start_conn": "Pinned", "end_conn": "Pinned"},
        {"member_type_num": 0, "start_node_num": 3, "end_node_num": 4, "start_conn": "Fixed", "end_conn": "Fixed"},
        {"member_type_num": 1, "start_node_num": 3, "end_node_num": 1, "start_conn": "Pinned", "end_conn": "Pinned"},
        {"member_type_num": 1, "start_node_num": 1, "end_node_num": 4, "start_conn": "Pinned", "end_conn": "Pinned"},
        {"member_type_num": 1, "start_node_num": 4, "end_node_num": 2, "start_conn": "Pinned", "end_conn": "Pinned"},
    ],

    // Supports on nodes
    "supports_custom": [
        {"node_num": 0, "type": "Pinned"},
        {"node_num": 2, "type": "Pinned"},
    ],

    // Loads
    "distLoads_custom": [
        {"element_num": 3, "w": 1, "x_s": 0, "x_e": 3000, "theta": -90},
    ],
    "pointLoads_custom": [],
    "momentLoads_custom": []
}

Response

Upon successful submission, the response will contain a solution_id in the ["data"]["id"] field, which can be used to retrieve the calculation results.