ResponseVault
  • Getting Started with Procore
  • Configure drop down items to come from an API
  • Styling the form
  • Advanced Form Configuration
Powered by GitBook
On this page
  • Connecting to an external API.
  • URL
  • Headers
  • Procore Example
  • Records
  • Label
  • Value

Was this helpful?

Configure drop down items to come from an API

PreviousGetting Started with ProcoreNextStyling the form

Last updated 5 years ago

Was this helpful?

First, choose React Select from the list of widgets

Connecting to an external API.

URL

The URL of the API endpoint you want to pull data from.

For Procore, you can use our system to authorize. .

For ResponseVault, all requests to Procore use the URL /procore/api then the endpoint from the docs, then any parameters using the query parameter.

Headers

Headers are additional key/value pairs that are send with the request. This is sometimes used for authentication, but can also be used to send additional information to the API.

Procore Example

You must have for this to work.

The URL to get a list of projects is /procore/api?endpoint=/vapid/projects&query[company_id]=1234

Which returns:

[
  {
    "id": 12738,
    "name": "Lakeside Mixed Use",
    "display_name": "12 - Lakeside Mixed Use",
    "project_number": "12",
    "address": "123 First St.",
    "city": "Carpinteria",
    "state_code": "CA",
    "country_code": "US",
    "zip": "93103",
    "county": "Santa Barbara County",
    "latitude": 34.3850464855729,
    "longitude": -119.490849121334,
    "stage": "Course of Construction",
    "phone": "480-800-5555",
    "created_at": "2014-12-29T21:53:56Z",
    "updated_at": "2015-04-20T18:09:33Z",
    "active": true,
    "origin_id": "OD-2398273424",
    "origin_data": "459247544",
    "origin_code": "Code 123",
    "owners_project_id": 1234,
    "total_value": 10000,
    "project_region_id": 1,
    "project_bid_type_id": 1,
    "project_owner_type_id": 1,
    "photo_id": 1,
    "start_date": "2019-10-31T00:00:00.000Z",
    "completion_date": "2020-10-31T00:00:00.000Z",
    "estimated_value": 10000,
    "company": {
      "id": 1234,
      "name": "CA Construction"
    }
  }
]

Records

Since the records that are returned are at the root of the array(notice the [ ] that the record is inside), for procore, we don't need to have a value for this.

Label

The name of the key in the response that you want to show in the form. In this case we would type in: name and Lakeside Mixed Use would appear as an option in the select box.

Value

The value that is saved to the database. In our case, we would want the record ID, which is id and will store 12738 when Lakeside Mixed Use is chosen from the select box.

Procore API Reference Docs
Procore authorized