Introduction
This document covers creating a record against a form that has already been created and released. For more information on how to generate forms via the API please refer to the Form Definition Section.
Getting Started
All API requests require an authorization token – reference our Authentication page for more information
NoteForms may have additional formatting, like sections or field groups like the example screenshot’s Safety Review. These additional formatting options are for a manual users’ benefit but will cause additional nesting in the form definition response. When designing forms that will have their records created only by API it is recommended these formatting features are not used.
Dependency rules and expressions will not be provided in the response, but rules will be evaluated at server side when a user submits data.
Create Records / Submit Form Data - High Volume
Create a record using the form definition response from the previous section of this document. This request is limited to Check and Audit type forms. The SubmitRecord API request accepts the same format as AddSubmitFormRequest. Requests submitted with SubmitRecord are NOT visible in the Admin Tools – Data Provisioning Import UI. The maximum number of SubmitRecord submissions is 400 per minute.
API Structure
POST api/integration/SubmitRecord
Required Request Parameters
Name | Location | Description |
---|---|---|
Authorization Token | Header | See Login Authentication API documentation |
Form Ref | Body | Form Name |
Resource | Body | Resource Name, only one may be selected |
Location | Body | Location Name linked to a Resource, only one may be selected |
Form Details | Body | For each field on the form include the shortname and value to be passed for that field – use GetRecordFormDefinition to view which fields to pass |
Operation | Body | Always use value Insert to create a record |
Optional Request Parameters
Name | Location | Description |
---|---|---|
SubmittedDate | Body | The SubmittedDate may be included but it must be provided in UTC. When the record is processed the SubmittedDate provided in the request will be used to update the SubmittedDate in the record, if the SubmittedDate is not provided then the system will set SubmittedDate to ProcessedDate. |
RequestNo | Body | The RequestNo may be included in the JSON request. This is an Alpha/Numeric value that can be include to assist with identifying the request when multiple requests are included in the sample payload. |
Request JSON single record
{
"Data": {
"RecordSummaryDetail": [
{
"FormRef": {
"Name": "Weight Sample Check"
},
"Resource": {
"Name": "Rye Flour"
},
"Location": {
"Name": "Site"
},
"RecordData": {
"FormDetails": [
{
"Value": "1 lb",
"ShortName": "Bag Size"
},
{
"Value": "1.15",
"ShortName": "Sample Weight Check"
}
]
}
}
]
},
"Operation": "Insert",
"Status": true,
"Errors": null,
"RefreshToken": false,
"PartialSuccess": true
}
Example with SubmittedDate Parameter
{
"Data": {
"RecordSummaryDetail": [{
"FormRef": {
"Name": "Weight Sample Check"
},
"Resource": {
"Name": "Rye Flour"
},
"Location": {
"Name": "Site"
},
"RecordData": {
"FormDetails": [{
"Value": "1 lb",
"ShortName": "Bag Size"
}, {
"Value": "1.15",
"ShortName": "Sample Weight Check"
}
]
},
"SubmittedDate": "12-16-2020 05:29:05"
}
]
},
"Operation": "Insert",
"Status": true,
"Errors": null,
"RefreshToken": false,
"PartialSuccess": false
}
Example with RequestNo Parameter
{
"Data": {
"RecordSummaryDetail": [
{
"RequestNo": "1",
"FormRef": {
"Name": "Weight Sample Check"
},
"Resource": {
"Name": "Rye Flour"
},
"Location": {
"Name": "Site"
},
"RecordData": {
"FormDetails": [
{
"Value": "1 lb",
"ShortName": "Bag Size"
},
{
"Value": "1.15",
"ShortName": "Sample Weight Check"
}
]
},
"SubmittedDate": "12-16-2020 05:29:05"
}
]
},
"Operation": "Insert",
"Status": true,
"Errors": null,
"RefreshToken": false,
"PartialSuccess": false
}
Response Parameters
Name | Description |
---|---|
Records | Use these record GUID within the GetSubmitRecordStatus API to request updates on the status of the SubmitRecord request. Refer to the GetSubmitRecordStatus API section of this document for more information. |
RequestStatus | If no syntax errors are present the default response is Pending until the request can be processed. |
RequestError | Error object providing information if an error occurs |
DetailedError | Error object providing information if an error occurs |
Status | Indicating the success of the API request |
Errors | Error object providing information if an error occurs |
RefreshToken | Returns false and is reserved for SCS future use |
Response JSON
{
"Records": [
"54C604E6-EB2F-4BF9-9CEB-2B9F2D399929",
"EE4ED9DB-579C-4C3C-91B5-03D2514931A8",
"986A632D-2C85-4C3D-8296-9D611ED849FD"
],
"RequestStatus": "Pending",
"RequestError": null,
"DetailedError": null,
"Status": true,
"Errors": null,
"RefreshToken": false
}
Response JSON with RequestNo
{
"Records": [
{
"RecordId": "54C604E6-EB2F-4BF9-9CEB-2B9F2D399929",
"RequestNo": "1"
},
{
"RecordId": "EE4ED9DB-579C-4C3C-91B5-03D2514931A8",
"RequestNo": "2"
},
{
"RecordId": "986A632D-2C85-4C3D-8296-9D611ED849FD",
"RequestNo": "3"
}
],
"RequestStatus": "Pending",
"RequestError": null,
"DetailedError": null,
"Status": true,
"Errors": null,
"RefreshToken": false
}