1. Home
  2. How To: Use SwaggerHub to call the TreePlotter™ API

How To: Use SwaggerHub to call the TreePlotter™ API

This article details how to use our SwaggerHub Developer’s Documentation to run calls using the API. This will be a learning tool that can be used in creation of an API Integration with TreePlotter and another software within your organization.

Step 1: Authenticate

  1. In the top right of the SwaggerHub page, you will select the region URL that you use using the drop down.
  2. At the top, right of the SwaggerHub page click the green Authorize Button
  3. Enter your TreePlotter log in credentials in the basicAuth section.
  4. Click Authorize.
  5. In the apiKey section, enter the API Key for your TreePlotter account.
    • If you do not have an API key, reach out to support@planitgeo.com to purchase access to our API.
  6. Click Authorize.
  7. Close out of the authenticate window.
Authenticate Steps 1 and 2.
Authenticate Steps 3 and 4.
Authenticate Steps 5 and 6.

Step 2: Running API Calls

  1. Using the available drop downs, select the call you are looking to make.
  2. Click Try It Out in the top right corner.
  3. Enter in the credentials you wish to insert into the API call.
    • Be sure to enter your Folder Name. This is the name to the right of the last “/ “in your TreePlotter URL (pg-cloud.com/foldername).
    • This must be inserted in all lower case letters.
    • Other credentials include a bounding box, date filters, Client Site primary ID’s etc.
  4. Click Execute.
Step 1 and 2. Select a call to make, click on Try it Out.
Step 3 and 4. Enter the folder name, and click execute.

Step 3: Understanding SwaggerHub API responses

  • A successful API call will output three sections into the interface.
  • The Snippets section will contain code snippets that are able to be copied out and used in your API integration code.
  • The Code section will contain the status of the call along with response body, response headers, and the duration of the call.
  • The Response section will contain your TreePlotter data.
  • The SwaggerHub responses will include a geojson of the data you wished to call or a confirmation that the action was done.
  • To extract out the API call you used for use in programming an API integration, click on the Snippet and the clipboard to copy out the curl and paste it into your code. Adjustments will have to be made for the appropriate coding language you are using.
  • To call the next page, see the bottom of the response to your initial call.
Click on the clipboard to copy out the API call or the response.

Next Steps:

Updated on February 4, 2025