Sent Forms REST API

Sent Forms REST API

Overview

The Sent Forms REST API allows you to manage Sent Forms for your company. It also allows API Developers the ability to mimic the functionality of the Data Integration Module (DIM) using their own code. API Developers can get all available Sent Forms for a Form Template based on their criteria. They can then access the data of each Sent Form and use it however they want.

Base URL 

https://fieldconnect.field2base.com/v2/api

Header (required)
Authorization: Basic {CompanyID}:{Username}:{Password}:{API Sync Key}
Content-Type: application/json
Note: Authorization Header above is the same as all other Mobile Forms REST API calls. 
Note: API Developers can use OAuth 2.0 Authentication instead of the Basic Authentication. The OAuth 2.0 Authentication uses the Client Credentials Grant Type and requires the Company have a Client ID and a Client Secret generated in the Mobile Forms Portal to make web service calls to the REST API Endpoints. You can contact the Professional Services team at f2bps@field2base.com to implement OAuth 2.0 Authentication.


Supported Operations

Append to the base URL: https://fieldconnect.field2base.com/v2/api
  1. POST onlinedocs/getsentforms
    1. Retrieves a list of Sent Forms for a Form Template ID
    2. Optional parameters are available
  2. GET onlinedocs/feed/integration
    1. Get a history of all Sent Forms for an individual Form Template
    2. 3 Required Parameters - formTemplateID, start, limit
    3. Start Parameter - The start parameter is the minimum Integration Sequence Number to return for the specified Form Template’s Sent Form history. The Integration Sequence Number defines the ordering of Sent Forms in the integration feed. The actual value is not meaningful and will contain gaps from one Sent Form to the next. The Integration Sequence Number should be kept as a bookmark to track where in the Sent Form history the custom integration is. A Sent Form's Integration Sequence Number is included in the returned JSON object (IntegrationSequence). To do paging, make the initial request with the start parameter equal to 1 and then record the value (i.e. in a local database) for the IntegrationSequence property of the last Sent Form in the result set. The next time a request is made the recorded Integration Sequence Number should be incremented by 1 and sent as the value for the start parameter.
  3. GET onlinedocs/sentforms/{resourceID}/PDF
    1. Retrieves a rendered PDF of a Sent Form
  4. GET onlinedocs/sentforms/{ResourceID}/xml 
    1. Retrieves a Sent Form as XML data
  5. GET onlinedocs/sentforms/{ResourceID}/json
    1. Retrieves a Sent Form as JSON data
  6. GET onlinedocs/sentforms/{ResourceID}/media/regions/{RegionName}
    1. Retrieves a Sent Form's media files 


API Samples  

Get Sent Forms

Request: POST
  1. https://fieldconnect.field2base.com/v2/api/onlinedocs/getsentforms
Body
  1. {
  2.     "templateId": "e8bac552-3486-47ff-87ed-6cfaf3c1c0fb",
  3.     "searchLimit":1 // must be at least 1
  4. }
Body with Optional Parameters
  1. {
  2.     "templateId": "e8bac552-3486-47ff-87ed-6cfaf3c1c0fb",
  3.     "allUsers": "true",     // defaults to false, true will only return a sent form from the logged in user
  4.     "searchLimit":1,      //must be at least 1
  5.     "includeUnreleased": "true",     //default is false
  6.     "minTimestamp": "2021-02-01T00:00:00-05:00",
  7.     "maxTimestamp": "2021-02-15T00:00:00-05:00",
  8.     "data": [
  9.         ["Page1@FirstName","equals","Joe"],     //search types include: equals, startswith, endswith, contains
  10.         ["Page1@LastName","contains","Schmoe"]
  11.     ]
  12. }
Note: In order to use the "data" filtering option, Region Filters must first be created for the Form Template in the Portal (Admin > Form Templates > Region Filters) to capture the data. See the article on  Region Filters for details on how to create regions filters for a Form.
Currently, region filters are limited to 5 per form. 

Response: 200 OK
  1. [
  2.     {
  3.         "ResourceId": "70599f64-d119-4a93-aea1-84622ccaa654",
  4.         "FriendlyName": "Sample Timesheet - Job#: 15-201 - Supervisor 2 - Week Ending: 2/18/2021",
  5.         "RefNum": 17150934,
  6.         "RfiTimestamp": "2021-02-18T12:40:44.813",
  7.         "WorkflowStatus": null,
  8.         "IsClaimable": false
  9.     }
  10. ]

Get Sent Form History

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/onlinedocs/feed/integration?formTemplateID=ff95774c-265a-4dce-8d15-f7ce4a4a170f&start=1&limit=10
Response: 200 OK
  1. [
  2.     {
  3.         "ResourceId": "3173db6a-a091-4a70-9bc3-acefb21ed89f",
  4.         "FriendlyName": "Sample Work Order - 1234555TEST",
  5.         "RefNum": 23923295,
  6.         "RfiTimestamp": "2023-09-21T15:12:17.373Z",
  7.         "IntegrationSequence": 24844788,
  8.         "SenderUserKey": "6a39d22e-26ba-4975-8813-1dbe87971d4a",
  9.         "SenderUsername": "User@field2base.com",
  10.         "TabletSerial": null,
  11.         "WorkOrderId": null
  12.     }
  13. ]

Get Sent Form PDF

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/onlinedocs/sentforms/70599f64-d119-4a93-aea1-84622ccab654/pdf

Response: 200 OK
PDF is returned as data in the contents of the body of the response with a content disposition of “inline”

Get Sent Form XML

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/onlinedocs/sentforms/70599f64-d119-4a93-aea1-84622ccab659/xml

Response: 200 OK
  1. <?xml version="1.0" encoding="utf-16"?>
  2. <FormData>
  3.     <Header>
  4.         <Title>Sample Work Order</Title>
  5.         <FileVersion>7.0.0</FileVersion>
  6.         <FormTemplateId>ff90774c-265a-4dce-8c15-f7ce4a4a170f</FormTemplateId>
  7.         <FormRevisionNumber>3</FormRevisionNumber>
  8.         <FormDataId>5230d551-45a4-44e8-b3ea-c822eecb3f44</FormDataId>
  9.         <StartTimeUtc>2023-09-21T15:05:58.5490000Z</StartTimeUtc>
  10.         <SendTimeUtc>2023-09-21T15:12:14.5930000Z</SendTimeUtc>
  11.         <SenderUsername />
  12.         <SenderMachineName />
  13.         <SenderSystemUserId>6a39d22e-26ba-4975-8813-1dbe87971d4a</SenderSystemUserId>
  14.         <SenderSystemUserFriendlyName>Test User</SenderSystemUserFriendlyName>
  15.     </Header>
  16.     <Values>
  17.         <Page UserPageNumber="1" Name="PageName1">
  18.             <Region Name="Address" Type="Text" DataColumn="">
  19.                 <Value>444 Books Rd.</Value>
  20.             </Region>
  21.             <Region Name="City" Type="Text" DataColumn="">
  22.                 <Value>Carcosa</Value>
  23.             </Region>
  24.             <Region Name="CompanyName" Type="Text" DataColumn="">
  25.                 <Value>F2B</Value>
  26.             </Region>
  27.             <Region Name="ContactName" Type="Text" DataColumn="">
  28.                 <Value>Conan the Librarian</Value>
  29.             </Region>
  30.             <Region Name="Date" Type="Date" DataColumn="">
  31.                 <Value>9/21/2023</Value>
  32.             </Region>
  33.             <Region Name="Description" Type="Text" DataColumn="">
  34.                 <Value>TEST</Value>
  35.             </Region>
  36.             <Region Name="HoursWorked" Type="Numeric" DataColumn="">
  37.                 <Value>123</Value>
  38.             </Region>
  39.             <Region Name="PhoneNumber" Type="Numeric" DataColumn="">
  40.                 <Value>1234567890</Value>
  41.             </Region>
  42.             <Region Name="Signature" Type="Pen" DataColumn="">
  43.                 <Value>R0lGODlh2gAmAPcAAAAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAACH5BAEAAPwALAAAAADaACYAAAj/APcJHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOqXMmypcuXMGPKnEmzps2bOHPq3Mmzp8+fQIMKHSqRmDKjk9AkFXMjBppMxIhK9UkMjRgDAJo2VaoUqrJJTAFknQR1qlmYmcSIvUG2XsSqYdEoO0v3ZKYYN6JunBRDDLS6gD9mAiBmruAVhQMrtqhMLZqSd2+0jKF3sUu+mVLerWzybmbLLZU5nfyZpLIbYkC7RBPDcEvWI9Ou4KwapbIVk2QSa/1xkgExpWun5Pt3pmjXGNMSdit8ZSbJN3lbJKYWePPQMXKKrogma/DrKuvFjSiOc3vESQAyMQffMi/P3Q/vpmb/0nrPtA1RI6fPEsB+htAQkxQatI1kH0Lifcdffwwpk8kkTa0lRlL/jeTeQcctCBM0/hFjFDFQVXXDCgDEEANZBa4kHUF3aSgTU3jhpdUkxJBHk3kDQejijhnhOBqPQFoEljL+BWlkRU0dqeSSTDbp5JNQRinllA4FBAA7</Value>
  44.             </Region>
  45.             <Region Name="State" Type="Text" DataColumn="">
  46.                 <Value>Despair</Value>
  47.             </Region>
  48.             <Region Name="WorkOrderNumber" Type="Numeric" DataColumn="">
  49.                 <Value>1234555</Value>
  50.             </Region>
  51.             <Region Name="WorkPerformedBy" Type="Datasource" DataColumn="">
  52.                 <Value>Jeremy</Value>
  53.             </Region>
  54.             <Region Name="ZIP" Type="Numeric" DataColumn="">
  55.                 <Value>99999</Value>
  56.             </Region>
  57.             <Region Name="Notes" Type="Text" DataColumn="">
  58.                 <Value>No notes here...</Value>
  59.             </Region>
  60.         </Page>
  61.     </Values>
  62. </FormData>

Get Sent Form JSON

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/onlinedocs/sentforms/70599f64-d119-4a93-aea1-84622ccab054/json

Response: 200 OK
  1. {
  2.     "header": {
  3.         "title": "Sample Work Order",
  4.         "formTemplateId": "ff98774c-265a-4dce-8c15-f7ce4a4a170f",
  5.         "formRevisionNumber": 3,
  6.         "formDataId": "5130d551-45a4-44e8-b3ea-c822eecb3f44",
  7.         "startTimeUtc": "2023-09-21T15:05:58.549Z",
  8.         "sendTimeUtc": "2023-09-21T15:12:14.593Z",
  9.         "senderSystemUserId": "6a38d22e-26ba-4975-8813-9dbe87971d4a",
  10.         "senderSystemUserFriendlyName": "Test User"
  11.     },
  12.     "values": {
  13.         "Page1@Address": "444 Books Rd.",
  14.         "Page1@City": "Carcosa",
  15.         "Page1@CompanyName": "F2B",
  16.         "Page1@ContactName": "Conan the Librarian",
  17.         "Page1@Date": "9/21/2023",
  18.         "Page1@Description": "TEST",
  19.         "Page1@HoursWorked": "123",
  20.         "Page1@Notes": "No notes here...",
  21.         "Page1@PhoneNumber": "1234567890",
  22.         "Page1@State": "Despair",
  23.         "Page1@WorkOrderNumber": "1234555",
  24.         "Page1@WorkPerformedBy": "Jeremy",
  25.         "Page1@ZIP": "99999"
  26.     },
  27.     "media": {
  28.         "Page1@Signature": {
  29.             "mediaType": "ink"
  30.         }
  31.     }
  32. }

Get Media File for a Region

Request: GET
  1. https://fieldconnect.field2base.com/v2/api/onlinedocs/sentforms/3173db6a-a091-4a70-9bc3-acefb21dd82f/media/regions/Page1@Signature
Response: 200 OK
Media is returned as image, audio or video file

    • Popular Articles

    • Forms Designer Quick Start Guide

      Overview Field2Base Forms Designer is the proprietary software application that allows your existing paper forms to be quickly converted to a smart E-form available to your end users via our mobile and web-based Mobile Forms applications. This ...
    • Portal 11.28.2023 Release Notes

      Overview Our release notes offer brief descriptions of product enhancements and bug fixes. We include links to the current articles for any affected features. Those articles will be updated shortly after the Portal release to include new ...
    • Integration Service Configuration Guide

      How To Configure Integration Services To Allow Read/Write Access on a Network Path All of our Integration Products, including the DIM, DUU, and EDM have respective Windows Services responsible for communicating with our server. Occassionally, ...
    • Data Integration Module (DIM) Migration Guide

      Overview This article provides the information necessary to migrate the Field2Base Data Integration Module (DIM) over from one server to another. Please refer to the DIM Install Guide for the initial installation of the Field2Base DIM. Once that's ...
    • How to Check the Version of Integration Products Running on a Windows 10 Machine

      Right-click on the Start menu button. Click on Apps & Features. In the Apps & Features search bar type in the Integration Product you are looking for, eg. F2B Data Integration Module, F2B Data Upload, or F2B Enterprise Dispatch Module. Click to ...