Table of Contents

Pure Farming Streaming API

Streaming

GET data/streaming/datasets

Lists the available datasets

Request
GET /data/streaming/datasets
Parameters
Name Type Default Notes
X-Requested-Region

A 2 letter country code (ISO3166-1 alpha 2 code) to the region the data should be pulled from.

Responses
Status Code Type Description Samples
200 MoA.Platform.Data.Api.Common.Streaming.Dataset[]

Success

GET data/streaming/datasets/{dataset}

The metadata (available endpoints) for a particular dataset

Request
GET /data/streaming/datasets/{dataset}
Parameters
Name Type Default Notes
*dataset
X-Requested-Region

A 2 letter country code (ISO3166-1 alpha 2 code) to the region the data should be pulled from.

Responses
Status Code Type Description Samples
200 MoA.Platform.Data.Api.Common.Streaming.Dataset

Success

404 Microsoft.AspNetCore.Mvc.ProblemDetails

Not Found

GET data/streaming/datasets/{dataset}/changes

Returns the latest version of each item for a given dataset

You may optionally specify a continuation token (@continuation) as a since parameter to limit the response to items that have changed since the previous request

Request
GET /data/streaming/datasets/{dataset}/changes[?since&limit]
Parameters
Name Type Default Notes
*dataset

You may optionally specify a continuation token (@continuation) as a since parameter to limit the response to items that have changed since the previous request

since

Providing the continuation token (@continuation) from the previous request as the since parameter will limit the response to only items that have changed since the last request was made. If you don't provide this you get the latest version of all items you have access to in this dataset

limit

You may optionally specify a continuation token (@continuation) as a since parameter to limit the response to items that have changed since the previous request

X-Requested-Region

A 2 letter country code (ISO3166-1 alpha 2 code) to the region the data should be pulled from.

Responses
Status Code Type Description Samples
200 array

Success

Mime type: text/plain
[{"id":"@context","description":"holdings"},{"itemsGoHere":"There will be 0 or more number of items of type {Dataset} here, with the continuation token at the end..."},{"id":"@continuation","token":"eyJWZXJzaW9uIjoxLCJMYXN0UmVjb3JkVGltZSI6IjIwMjQtMDItMjZUMDM6MTk6MzQuODUyMTQ1NCswMDowMCJ9"}]
Mime type: application/json
[
  {
    "id": "@context",
    "description": "holdings"
  },
  {
    "itemsGoHere": "There will be 0 or more number of items of type {Dataset} here, with the continuation token at the end..."
  },
  {
    "id": "@continuation",
    "token": "eyJWZXJzaW9uIjoxLCJMYXN0UmVjb3JkVGltZSI6IjIwMjQtMDItMjZUMDM6MTk6MzQuODUyMTQ1NCswMDowMCJ9"
  }
]
Mime type: text/json
[{"id":"@context","description":"holdings"},{"itemsGoHere":"There will be 0 or more number of items of type {Dataset} here, with the continuation token at the end..."},{"id":"@continuation","token":"eyJWZXJzaW9uIjoxLCJMYXN0UmVjb3JkVGltZSI6IjIwMjQtMDItMjZUMDM6MTk6MzQuODUyMTQ1NCswMDowMCJ9"}]
400 Microsoft.AspNetCore.Mvc.ProblemDetails

Bad Request

404 Microsoft.AspNetCore.Mvc.ProblemDetails

Not Found

POST data/streaming/datasets/{dataset}/resources

Send a stream of data for a particular resource type

Supply a list of objects that match the dataset, in JSON format. You can find the different types of objects on the developer hub: https://developer.purefarming.com/streaming-api/#supported-resource-types

It is important to note that a 200 OK response does not indicate all objects were successfully processed - inspect the result to see the status for each object

Request
POST /data/streaming/datasets/{dataset}/resources
Parameters
Name Type Default Notes
*dataset

Supply a list of objects that match the dataset, in JSON format. You can find the different types of objects on the developer hub: https://developer.purefarming.com/streaming-api/#supported-resource-types

It is important to note that a 200 OK response does not indicate all objects were successfully processed - inspect the result to see the status for each object

X-Requested-Region

A 2 letter country code (ISO3166-1 alpha 2 code) to the region the data should be pulled from.

Responses
Status Code Type Description Samples
200 MoA.Platform.Data.Api.Common.Streaming.ResultResponse[]

Success

404 Microsoft.AspNetCore.Mvc.ProblemDetails

Not Found

GET data/streaming/control

Information on which holdings and resource types you have permission to publish data about

Request
GET /data/streaming/control
Parameters
Name Type Default Notes
X-Requested-Region

A 2 letter country code (ISO3166-1 alpha 2 code) to the region the data should be pulled from.

Responses
Status Code Type Description Samples
200 MoA.Platform.Data.Api.Mediatr.Streaming.ControlResponse[]

Success

404 Microsoft.AspNetCore.Mvc.ProblemDetails

Not Found

Definitions

MoA.Platform.Data.Api.Common.Streaming.Dataset

Name Type Notes
name string

Unique dataset name exposes by this service endpoint.

url string

Dataset url

changes string

Url that exposes the changes for this dataset

updates string

Url that streams data in for this dataset

containedTypes array

An array of strings. Each value is the name of a resource type exposed in this dataset.

Microsoft.AspNetCore.Mvc.ProblemDetails

Name Type Notes
type string
title string
status integer (int32)
detail string
instance string

MoA.Platform.Data.Api.Common.Streaming.ResultResponse

Name Type Notes
index integer (int32)

The zero-indexed position of the data object in the incoming list

successful boolean

The object was successfully sent for processing

error string

Optional. If the object was not successfully sent for processing then an error message will be supplied here

MoA.Platform.Data.Api.Mediatr.Streaming.ControlResponse

Name Type Notes
holdingId string (uuid)

The PureFarming ID of the holding

connectedAt string (date-time)

The time this holding was connected to the data-source

signature string

A SHA256 Signature of the object

identifiers PureFarming.Schema.identifierType[]

Any identifiers related to this holding

resourceTypes MoA.Platform.Data.Api.Common.Streaming.ResourceTypeResponse[]

The resource types for this holding that you can supply data for

connectorIdentifiers MoA.Platform.Data.Api.Common.Shared.Identifier[]

Any identifiers related to the data connection

PureFarming.Schema.identifierType

Any identifiers related to this holding

Name Type Notes
scheme string
id string
additionalProperties object

MoA.Platform.Data.Api.Common.Streaming.ResourceTypeResponse

The resource types for this holding that you can supply data for

Name Type Notes
id string

The Id of the Resource Type (also known as the short code)

href string

The link to streaming dataset

changes string

The link to the streaming dataset where you can get changes for this resource type

updates string

The link to the streaming dataset where you can push updates for this resource type

description string

A description of this resource type

MoA.Platform.Data.Api.Common.Shared.Identifier

Any identifiers related to the data connection

Name Type Notes
id string

A unique identification for the resource issued under the auspices of the scheme.

scheme string

The identifier (in reverse domain format) of an official scheme that manages unique identifiers.