Didn't find what you're looking for? Submit a
Documentation Request
LogoLogo
AppsContact Support
API
API
  • Welcome to the Paragon API
  • Quickstarts
    • Getting Started with .NET
    • Getting Started with REST
  • Tutorials
    • Create a layout - .NET
  • Concepts
    • API Overview
  • Design API Overview
  • Coordinates
  • Samples
    • .NET Samples
    • Node.js Samples
  • Reference
    • REST
Powered by GitBook
On this page
  • Prerequisites
  • Obtain an API Key
  • Create a project
  • Create a truss
  • Analyze a truss
  • Additional Resources
  1. Quickstarts

Getting Started with REST

PreviousGetting Started with .NETNextCreate a layout - .NET

Last updated 16 days ago

Prerequisites

  • A with access to the REST API

  • (included by default with most Linux distributions and macOS, or accessible via on Windows)

Obtain an API Key

  1. Navigate to any Paragon app in your web browser (e.g., )

  2. Click on the user icon in the top-right

  3. Select "API Keys"

  1. Click "Create New Key"

  1. Click on the generated API key to copy it to your clipboard. Paste it somewhere secure, so that you can use it authenticate your requests. Note that this API key has the same privileges and access as your normal Paragon account, so keep it as secure as you would a password. There is no way to access it again in Paragon after you've generated it, so if you lose it, you'll have to create a new key.

Create a project

  1. Run the following cURL command to create a project with the name "Test API Project." Replace<YOUR-TOKEN> with the API key you generated in the last step.

curl https://designserver.paragontruss.com/api/public/projects \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: JWT <YOUR-TOKEN>' \
  --data '{
  "name": "Test API Project"
}'

If successful, it should respond with the Project JSON model:

{"guid":"75564bdf-0a00-4f62-9eb9-b92e272d8a08","name":"Test API Project"}
  1. Use the GUID from the response data to load the project in Design. The URL to load the project is https://design.paragontruss.com/<project-guid>, where <project-guid> is the GUID from the response data. You should see an empty project with "Test API Project" in the header bar.

Create a truss

  1. Run the following cURL command to create a truss within the project we created in the last step. Replace {project-guid} with the project GUID generated in the last step and replace<YOUR-TOKEN> with your API key.

curl 'https://designserver.paragontruss.com/api/public/projects/{project-guid}/createProfileTruss' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: JWT <YOUR-TOKEN>' \
  --data '{
  "name": "RT-1",
  "topChordPoints": [
    {
      "x": 0,
      "y": 4.163118960624631
    },
    {
      "x": 144,
      "y": 76.1631189606246
    },
    {
      "x": 288,
      "y": 4.163118960624631
    }
  ],
  "bottomChordPoints": [
    {
      "x": 0,
      "y": 0
    },
    {
      "x": 288,
      "y": 0
    }
  ],
  "leftOverhang": {
    "distance": 24
  },
  "rightOverhang": {
    "distance": 24
  }
}'

If successful, it should respond with the Truss JSON model:

{"guid":"e3c28e22-9c53-4cc5-914d-987b28c7ebdd","name":"RT-1","plies":1,"members":[{"guid":"65745380-6813-4193-ad6b-a8fc4f12665d","name":"T1","assemblyName":"T1","type":"TopChord","lumber":{"actualThickness":1.5,"actualWidth":3.5,"nominalWidth":4.0,"nominalThickness":2.0,"grade":"Number_2","species":"Southern_Pine","structure":"Sawn","treatmentType":"Untreated"},"geometry":[{"x":-24.0,"y":-7.836881039375365},{"x":-24.0,"y":-11.749999999999996},{"x":144.0,"y":72.24999999999997},{"x":144.0,"y":76.1631189606246}],"thickness":1.5,"overallLength":189.5797101099824,"bevelCuts":[]},{"guid":"9e114f93-2a8a-4f92-bdd8-c196daae1250","name":"T2","assemblyName":"T1","type":"TopChord","lumber":{"actualThickness":1.5,"actualWidth":3.5,"nominalWidth":4.0,"nominalThickness":2.0,"grade":"Number_2","species":"Southern_Pine","structure":"Sawn","treatmentType":"Untreated"},"geometry":[{"x":144.0,"y":76.16311896062459},{"x":144.0,"y":72.25},{"x":312.0,"y":-11.749999999999972},{"x":312.0,"y":-7.836881039375385}],"thickness":1.5,"overallLength":189.5797101099824,"bevelCuts":[]},{"guid":"d06538f8-b5b8-4db5-acf1-e5063b860e0a","name":"B1","assemblyName":"B1","type":"BottomChord","lumber":{"actualThickness":1.5,"actualWidth":3.5,"nominalWidth":4.0,"nominalThickness":2.0,"grade":"Number_2","species":"Southern_Pine","structure":"Sawn","treatmentType":"Untreated"},"geometry":[{"x":6.5000000000000036,"y":3.5},{"x":0.0,"y":0.24999999999999944},{"x":0.0,"y":0.0},{"x":288.0,"y":0.0},{"x":288.0,"y":0.2500000000000284},{"x":281.50000000000006,"y":3.5}],"thickness":1.5,"overallLength":288.0,"bevelCuts":[]},{"guid":"e920a76c-1faa-431b-98fa-e3d24e5cb9d7","name":"W1","assemblyName":"W1","type":"Web","lumber":{"actualThickness":1.5,"actualWidth":3.5,"nominalWidth":4.0,"nominalThickness":2.0,"grade":"Number_3","species":"Southern_Pine","structure":"Sawn","treatmentType":"Untreated"},"geometry":[{"x":93.83040109648518,"y":3.5},{"x":96.0,"y":3.5},{"x":96.0,"y":6.460598503754596},{"x":73.58780701877343,"y":37.0439035093867},{"x":70.41219298122658,"y":35.45609649061328}],"thickness":1.5,"overallLength":40.90067812331938,"bevelCuts":[]},{"guid":"aec1abc4-99d1-49b6-bd60-22c4219c5370","name":"W2","assemblyName":"W2","type":"Web","lumber":{"actualThickness":1.5,"actualWidth":3.5,"nominalWidth":4.0,"nominalThickness":2.0,"grade":"Number_3","species":"Southern_Pine","structure":"Sawn","treatmentType":"Untreated"},"geometry":[{"x":144.0,"y":69.19302527507037},{"x":144.0,"y":72.24999999999997},{"x":140.7210103509135,"y":70.61050517545672},{"x":96.0,"y":6.556974724929603},{"x":96.0,"y":3.5},{"x":98.13432417158722,"y":3.5000000000000004}],"thickness":1.5,"overallLength":83.84844959806945,"bevelCuts":[]},{"guid":"b42110e8-7b19-470e-abe5-0ca0d80be8a5","name":"W3","assemblyName":"W2","type":"Web","lumber":{"actualThickness":1.5,"actualWidth":3.5,"nominalWidth":4.0,"nominalThickness":2.0,"grade":"Number_3","species":"Southern_Pine","structure":"Sawn","treatmentType":"Untreated"},"geometry":[{"x":147.2789896490865,"y":70.61050517545675},{"x":144.0,"y":72.25},{"x":144.0,"y":69.1930252750704},{"x":189.86567582841278,"y":3.5},{"x":192.0,"y":3.5},{"x":192.0,"y":6.556974724929603}],"thickness":1.5,"overallLength":83.8484495980695,"bevelCuts":[]},{"guid":"54e9650b-92b4-407a-93f7-cd791572f2f6","name":"W4","assemblyName":"W1","type":"Web","lumber":{"actualThickness":1.5,"actualWidth":3.5,"nominalWidth":4.0,"nominalThickness":2.0,"grade":"Number_3","species":"Southern_Pine","structure":"Sawn","treatmentType":"Untreated"},"geometry":[{"x":192.0,"y":6.460598503754596},{"x":192.0,"y":3.5},{"x":194.1695989035148,"y":3.5000000000000004},{"x":217.58780701877342,"y":35.456096490613305},{"x":214.41219298122655,"y":37.04390350938674}],"thickness":1.5,"overallLength":40.9006781233194,"bevelCuts":[]}],"plates":[],"bearings":[{"guid":"83d1345f-86e1-43bd-9b8e-cc958c243fda","geometry":{"basePoint":{"x":0.0,"y":0.0},"endPoint":{"x":3.5,"y":0.0}}},{"guid":"ecf90985-38a0-48b2-ad9d-45b4dee9cff5","geometry":{"basePoint":{"x":284.5,"y":0.0},"endPoint":{"x":288.0,"y":0.0}}}],"outsideToOutsideBearingeight":87.9131189606246,"width":336.0}
  1. Refresh the project page in your browser. You should now see a truss in the project.

Analyze a truss

  1. Run the following cURL command to upgrade and analyze the truss created in the last step. Replace {truss-guid} with the truss GUID generated in the last step and replace<YOUR-TOKEN> with your API key.

curl 'https://designserver.paragontruss.com/api/public/trusses/{truss-guid}/upgradeAndAnalyze' \
  --header 'Authorization: JWT <YOUR-TOKEN>' \
  --request POST

If successful, it should respond with an AnalysisSet JSON model:

{"guid":"4cfae6a9-d3bc-4488-9d0e-1a682957663c","capacityRatio":0.96,"maximumBearingReactions":[{"jointLocation":{"x":3.552713678800501E-15,"y":1.75},"upForce":null,"downForce":-1158.565282011909},{"jointLocation":{"x":288.0,"y":1.75},"upForce":null,"downForce":-1158.5652820114412}],"requiredSlopedTopChordPurlinSpacing":45.867919921875,"requiredFlatTopChordPurlinSpacing":null,"requiredBottomChordPurlinSpacing":120.0}
  1. Refresh the project page in your project page in your browser. You should now see that the truss' label is green in the left sidebar and that the bottom chord has been upgraded from No. 2 to No. 1 lumber in order to pass analysis.

Additional Resources

API Reference
Node.js Sample App
paid Paragon Plan
cURL
Git Bash
https://design.paragontruss.com/