Data Sources (API)

 

sourcesFetch, upload, or download the content of data sources.

Prerequisites

  • Data sources must already be configured in the web portal. You cannot use an API endpoint to create a data source.
  • To use the fetch endpoint, the data source must be "fetchable," which means you can fetch from any type except:
    • Manual Upload
    • ProntoForms User List
    • Managed Data Source
  • To use the upload endpoint, the data source must be of the type Manual Upload.You
  • You can use the content endpoint with any type of existing data source.
  • Note the FormSpace and Data Source IDs for the data sources that you want to manage. See how to find these IDs.

Base URL

https://api.prontoforms.com

Note: You must use HTTPS to access the API endpoints.

Endpoints

POST
/api/1.1/formspaces/{formSpaceID}/sources/{sourceID}/fetch
Forces a fetch of dynamic data source contents from the remote service. This is equivalent to "Fetch New Data" in the web portal.
   

Request parameters

None

Request header

Include the standard authorization header. This includes the username and password, where username is the API Key ID and password is the API Key Secret. (see Setup an API Application on ProntoForms).

cURL examples

curl -v -k -u username:password -X POST https://api.prontoforms.com/api/1.1/formspaces/formSpaceID/sources/sourceID/fetch

where username is the API Key ID and password is the API Key Secret.

Request body

None

Response codes

200—OK

Response examples

This endpoint does not return a response body.

Error codes

Error code Error message HTTP response code Description
SourceNotFetchable Data Source Not Fetchable: This Data Source is not a Fetching Data Source 400 The data source is not supported. The type cannot be Manual Upload or ProntoForms User List.
AccessDenied Access Denied: You are not allowed to access the requested resource. 403 The data source doesn't exist in your team account.
ObjectNotFound Object Not Found: The object you requested could not be found 404 The system couldn't find the data source. Enter an existing data source ID.

 [ top ]

PUT
/api/1.1/formspaces/{formSpaceID}/sources/{sourceID}/upload.{extension}
Updates the data in an existing data source of type Manual Upload. Supported extensions are .csv, .xls, .xlsx, .json, and .xml.
   

Request parameters

Parameter Default value Required Description
delimiter , No The delimiter for CSV files.
encoding utf-8 No Specifies the character encoding of the content. For content generated from Microsoft Windows environments, set this to windows-1252.
suppressPush false No Specifies whether the update triggers any configured push notifications to mobile users.

Request header

Include the standard authorization header. This includes the username and password, where username is the API Key ID and password is the API Key Secret. (see Setup an API Application on ProntoForms).

cURL examples

curl -v -k -u username:password -X PUT --upload-file filename.extension https://api.prontoforms.com/api/1.1/formspaces/formSpaceID/sources/sourceID/upload.extension

where username is the API Key ID and password is the API Key Secret.

Request body

Include the content that you want to upload, as shown in the following examples.

CSV

Work Order ID,Work Type,Contact Name,Estimated Duration
1,Installation,D. Smith,30
2,Maintenance,R. Garcia,45
3,Warranty,Q. Johnson,60

JSON

[
 {
 "Work Order ID": 1,
 "Work Type": "Installation",
 "Contact Name": "D. Smith",
 "Estimated Duration": 30
 },
 {
 "Work Order ID": 2,
 "Work Type": "Maintenance",
 "Contact Name": "R. Garcia",
 "Estimated Duration": 45
 },
 {
 "Work Order ID": 3,
 "Work Type": "Warranty",
 "Contact Name": "Q. Johnson",
 "Estimated Duration": 60
 }
]

Response codes

200—OK

Response examples

This endpoint does not return a response body.

Error codes

Error code Error message HTTP response code Description
SourceHeaderTooLong Column headers can be a maximum of 255 characters in length. Header ''{1}'' was {0} characters in length. No data has been loaded. 400 One of the column headers exceeds the maximum value of 255 characters.
SourceNotUploadable Data Source Not Uploadable: This Data Source is not an upload Data Source 400 The data source must be a Manual Upload type.
AccessDenied Access Denied: You are not allowed to access the requested resource. 403 The data source doesn't exist in your team account.
ObjectNotFound Object Not Found: The object you requested could not be found 404 The system couldn't find the data source. Enter an existing data source ID.

 [ top ]

GET
/api/1.1/formspaces/{formSpaceID}/sources/{sourceID}/content.{extension}
Downloads the contents of a data source as a .csv, .xls, or .xlsx file. Supported extensions are .csv and .xlsx.
   

Request parameters

None

Request header

Include the standard authorization header. This includes the username and password, where username is the API Key ID and password is the API Key Secret. (see Setup an API Application on ProntoForms).

cURL examples

curl -v -k -u username:password -X POST https://api.prontoforms.com/api/1.1/formspaces/formSpaceID/sources/sourceID/content.extension

where username is the API Key ID and password is the API Key Secret.

To save the xls or xlsx output as a file:

curl -u username:password https://api.prontoforms.com/api/1.1/formspaces/formSpaceID/sources/sourceID/content.xlsx --output filename.xlsx

Request body

None

Response codes

200—OK

Response examples

The response is the content of the.csv, .xls, or .xlsx file (with .xls and .xlsx as binary output).

Error codes

Error code Error message HTTP response code Description
AccessDenied Access Denied: You are not allowed to access the requested resource 403 Your user account is not assigned to the FormSpace. Enter a different FormSpace ID, or ask your system administrator for the correct permissions.
ObjectNotFound Object Not Found: The object you requested could not be found 404 The system couldn't find the data source. Enter an existing data source ID.

[ top ]

How to find FormSpace and Data Source IDs

To find the formSpaceID and sourceID in the web portal:

  1. Go to the FormSpace that contains the Data Source: Manage Forms > List FormSpaces.

    Result: The page displays the number of data sources in each FormSpace.

  2. In the row for the FormSpace that contains the data source, click the number in the # of Data Sources column.
  3. Select a Data Source from the list.

    Result: The system displays the data source details, and you can see the formSpaceID and sourceID in the URL.

    DataSourceIDinURL.png

[ top ]

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments