Field Data API
This is a service which facilitates the flow of data to and from the field. It is an external API that provides mechanisms for creating, updating, retrieving, and deleting field data.
Data must conform to the appropriate schema when it is uploaded.
Jobs will be processed and have their features extracted when new data comes in.
Schemas
Section titled “Schemas”To read about core and job type schemas used in the Field Data API see the Design Patterns documentation.
Common Field Data Service Workflows
Section titled “Common Field Data Service Workflows”-
Get List Project Tenancies
gets a list of all projects the user has access to, allows filtering with the
Match String. This is useful if you forget theprojectTrn/projectId -
Get List Jobs
List all Jobs associated with a project. This is useful if you forget the
jobTrn/jobId. The List Jobs endpoint also contains accommodations for an RSQL filter expression. -
Get Job details
This is important for getting values like the
eTagwhich change often. -
Creating a new Job
A minimum JSON body for creating a new job
{ "name": "any string", "jobType": "any string although `Survey` has additional logic", "lifeState": "ACTIVE", "attributes": {}}-
Uploading a File and creating an Attachment
- Call
Upload file(s)endpoint make a note offileTrnwhich will be needed later anduploadUrlwhich is a signed URL for AWS S3 - Using the
uploadUrlupload a file to AWS S3
curl --upload-file <path/to/file> <uploadUrl from part 1>-
Call
Get Job Detailsto get the currenteTagvalue of the job -
Call the
Add Job Attachment(s)endpoint be sure to use the currenteTagvalue you got from part 3A minimum JSON body for adding an attachment
{"attachmentId": "<fileTrn from part 1>","tags": []}- Congratulations! File is uploaded and attached to the job. if the file is of the type
*.joband has the tagRootDataFileit will be sent to the Job Converter for processing. You should see a*.jxlfile also be attached to the job in 10 seconds or so.
- Call
-
Patch a Job
uses JSON Patch Operations to update the Job object.
minimum JSON body for updating the
attributesobject
{ "op": "add", "path": "/attributes", "value": { "description": "desc", "status": "NEW", "priority": "LOW", "tags": [], "assignees": [] }}-
Update a Job
replaces the job object with a new job object.
minimum JSON body
{ "name": "Testing", "jobId": "trn:jobs:job:b402c4b8-aa6c-4b77-b161-1b1567844737", "jobType": "Survey", "attributes": { "description": "desc", "status": "NEW", "priority": "LOW", "tags": [], "assignees": [] }}