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
- POST onlinedocs/getsentforms
- Retrieves a list of Sent Forms for a Form Template ID
- Optional parameters are available
- GET onlinedocs/feed/integration
- Get a history of all Sent Forms for an individual Form Template
- 3 Required Parameters - formTemplateID, start, limit
- 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.
- GET onlinedocs/sentforms/{resourceID}/PDF
- Retrieves a rendered PDF of a Sent Form
- GET onlinedocs/sentforms/{ResourceID}/xml
- Retrieves a Sent Form as XML data
- GET onlinedocs/sentforms/{ResourceID}/json
- Retrieves a Sent Form as JSON data
- GET onlinedocs/sentforms/{ResourceID}/media/regions/{RegionName}
- Retrieves a Sent Form's media files
API Samples
Request: POST
- https://fieldconnect.field2base.com/v2/api/onlinedocs/getsentforms
Body
- {
- "templateId": "e8bac552-3486-47ff-87ed-6cfaf3c1c0fb",
- "searchLimit":1 // must be at least 1
- }
Body with Optional Parameters
- {
- "templateId": "e8bac552-3486-47ff-87ed-6cfaf3c1c0fb",
- "allUsers": "true", // defaults to false, true will only return a sent form from the logged in user
- "searchLimit":1, //must be at least 1
- "includeUnreleased": "true", //default is false
- "minTimestamp": "2021-02-01T00:00:00-05:00",
- "maxTimestamp": "2021-02-15T00:00:00-05:00",
- "data": [
- ["Page1@FirstName","equals","Joe"], //search types include: equals, startswith, endswith, contains
- ["Page1@LastName","contains","Schmoe"]
- ]
- }
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
- [
- {
- "ResourceId": "70599f64-d119-4a93-aea1-84622ccaa654",
- "FriendlyName": "Sample Timesheet - Job#: 15-201 - Supervisor 2 - Week Ending: 2/18/2021",
- "RefNum": 17150934,
- "RfiTimestamp": "2021-02-18T12:40:44.813",
- "WorkflowStatus": null,
- "IsClaimable": false
- }
- ]
Get Sent Form History
Request: GET
- https://fieldconnect.field2base.com/v2/api/onlinedocs/feed/integration?formTemplateID=ff95774c-265a-4dce-8d15-f7ce4a4a170f&start=1&limit=10
Response: 200 OK
- [
- {
- "ResourceId": "3173db6a-a091-4a70-9bc3-acefb21ed89f",
- "FriendlyName": "Sample Work Order - 1234555TEST",
- "RefNum": 23923295,
- "RfiTimestamp": "2023-09-21T15:12:17.373Z",
- "IntegrationSequence": 24844788,
- "SenderUserKey": "6a39d22e-26ba-4975-8813-1dbe87971d4a",
- "SenderUsername": "User@field2base.com",
- "TabletSerial": null,
- "WorkOrderId": null
- }
- ]
Request: GET
- 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”
Request: GET
- https://fieldconnect.field2base.com/v2/api/onlinedocs/sentforms/70599f64-d119-4a93-aea1-84622ccab659/xml
Response: 200 OK
- <?xml version="1.0" encoding="utf-16"?>
- <FormData>
- <Header>
- <Title>Sample Work Order</Title>
- <FileVersion>7.0.0</FileVersion>
- <FormTemplateId>ff90774c-265a-4dce-8c15-f7ce4a4a170f</FormTemplateId>
- <FormRevisionNumber>3</FormRevisionNumber>
- <FormDataId>5230d551-45a4-44e8-b3ea-c822eecb3f44</FormDataId>
- <StartTimeUtc>2023-09-21T15:05:58.5490000Z</StartTimeUtc>
- <SendTimeUtc>2023-09-21T15:12:14.5930000Z</SendTimeUtc>
- <SenderUsername />
- <SenderMachineName />
- <SenderSystemUserId>6a39d22e-26ba-4975-8813-1dbe87971d4a</SenderSystemUserId>
- <SenderSystemUserFriendlyName>Test User</SenderSystemUserFriendlyName>
- </Header>
- <Values>
- <Page UserPageNumber="1" Name="PageName1">
- <Region Name="Address" Type="Text" DataColumn="">
- <Value>444 Books Rd.</Value>
- </Region>
- <Region Name="City" Type="Text" DataColumn="">
- <Value>Carcosa</Value>
- </Region>
- <Region Name="CompanyName" Type="Text" DataColumn="">
- <Value>F2B</Value>
- </Region>
- <Region Name="ContactName" Type="Text" DataColumn="">
- <Value>Conan the Librarian</Value>
- </Region>
- <Region Name="Date" Type="Date" DataColumn="">
- <Value>9/21/2023</Value>
- </Region>
- <Region Name="Description" Type="Text" DataColumn="">
- <Value>TEST</Value>
- </Region>
- <Region Name="HoursWorked" Type="Numeric" DataColumn="">
- <Value>123</Value>
- </Region>
- <Region Name="PhoneNumber" Type="Numeric" DataColumn="">
- <Value>1234567890</Value>
- </Region>
- <Region Name="Signature" Type="Pen" DataColumn="">
- <Value>R0lGODlh2gAmAPcAAAAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDV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VaoUqrJJTAFknQR1qlmYmcSIvUG2XsSqYdEoO0v3ZKYYN6JunBRDDLS6gD9mAiBmruAVhQMrtqhMLZqSd2+0jKF3sUu+mVLerWzybmbLLZU5nfyZpLIbYkC7RBPDcEvWI9Ou4KwapbIVk2QSa/1xkgExpWun5Pt3pmjXGNMSdit8ZSbJN3lbJKYWePPQMXKKrogma/DrKuvFjSiOc3vESQAyMQffMi/P3Q/vpmb/0nrPtA1RI6fPEsB+htAQkxQatI1kH0Lifcdffwwpk8kkTa0lRlL/jeTeQcctCBM0/hFjFDFQVXXDCgDEEANZBa4kHUF3aSgTU3jhpdUkxJBHk3kDQejijhnhOBqPQFoEljL+BWlkRU0dqeSSTDbp5JNQRinllA4FBAA7</Value>
- </Region>
- <Region Name="State" Type="Text" DataColumn="">
- <Value>Despair</Value>
- </Region>
- <Region Name="WorkOrderNumber" Type="Numeric" DataColumn="">
- <Value>1234555</Value>
- </Region>
- <Region Name="WorkPerformedBy" Type="Datasource" DataColumn="">
- <Value>Jeremy</Value>
- </Region>
- <Region Name="ZIP" Type="Numeric" DataColumn="">
- <Value>99999</Value>
- </Region>
- <Region Name="Notes" Type="Text" DataColumn="">
- <Value>No notes here...</Value>
- </Region>
- </Page>
- </Values>
- </FormData>
Request: GET
- https://fieldconnect.field2base.com/v2/api/onlinedocs/sentforms/70599f64-d119-4a93-aea1-84622ccab054/json
Response: 200 OK
- {
- "header": {
- "title": "Sample Work Order",
- "formTemplateId": "ff98774c-265a-4dce-8c15-f7ce4a4a170f",
- "formRevisionNumber": 3,
- "formDataId": "5130d551-45a4-44e8-b3ea-c822eecb3f44",
- "startTimeUtc": "2023-09-21T15:05:58.549Z",
- "sendTimeUtc": "2023-09-21T15:12:14.593Z",
- "senderSystemUserId": "6a38d22e-26ba-4975-8813-9dbe87971d4a",
- "senderSystemUserFriendlyName": "Test User"
- },
- "values": {
- "Page1@Address": "444 Books Rd.",
- "Page1@City": "Carcosa",
- "Page1@CompanyName": "F2B",
- "Page1@ContactName": "Conan the Librarian",
- "Page1@Date": "9/21/2023",
- "Page1@Description": "TEST",
- "Page1@HoursWorked": "123",
- "Page1@Notes": "No notes here...",
- "Page1@PhoneNumber": "1234567890",
- "Page1@State": "Despair",
- "Page1@WorkOrderNumber": "1234555",
- "Page1@WorkPerformedBy": "Jeremy",
- "Page1@ZIP": "99999"
- },
- "media": {
- "Page1@Signature": {
- "mediaType": "ink"
- }
- }
- }
Request: GET
- 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