- Home
- /
- Streaming API
- /
- Resources
Resources Endpoint
You can publish data into a dataset using the resources endpoint
POST /data/streaming/dataset/{datasetid}/resources
where datasetId
is the name of the dataset.
Request Structure
Supply a list of objects that match the dataset specification. For example, for the plots
dataset:
[
{
"totalArea": {
"measurement": 2000,
"units": "MTK"
},
"totalLength": {
"measurement": 100,
"units": "MTK"
},
"identifiers": [
{
"id": "79daf037-407e-49b0-b385-6cb5b9e5453c",
"scheme": "com.purefarming.holdingId"
}
],
"name": "My Plot",
"resourceType": "/core/plot",
"dataPointKey": "a-unique-id-in-my-system-for-this-plot"
}
]
See Supported Resource Types for a list of resource types the streaming API will accept.
Response Structure
A response from the resources endpoint tells you if inserting the data into Pure Farming succeeded or failed. The response is an array of items providing the status of each original item pushed.
[
{
"successful": true,
"index": 0
},
{
"successful": false,
"index": 1,
"error": "Could not find Holding for: "com.purefarming.holdingId":"79daf037-407e-49b0-b385-6cb5b9e5453c""
},
...
]
Response Item | Description | Data Type |
---|---|---|
Successful | Whether the item at position index was successfully queued for processing in Pure Farming |
Boolean |
Index | The zero-indexed position of the object in the incoming list that was sent | Integer |
Error | An error message if the object could not be queued for processing in Pure Farming | String |