Create an individual object on a data set:
POST https://ip-or-hostname/io/api/1/dataset/:id
curl \
-X POST \
-d key=:apiKey \
https://ip-or-hostname/io/api/1/dataset/:id
This method will create a new record in a given data set where:
:apiKey
is the API key to use for access (see below):id
is the data set id (a UUID), per the /datasets
API. The data set ID can also be found in the Data set inspector of the Data tab for the data set.Note that you will most likely wish to pass other parameters as well to set values. The specific names of these parameters depend upon your data set schema. Please see below.
clientId
will be an integer or UUID which mean you'd need to look up the user to understand who made what changes. Note that while the clientId
should be unique per client and not change - the clientName
can change and will be updated to reflect the latest value given (e.g. if a user modifies their name in your own system).
Similar to role
but allows multiple roles to be specified.dp-{number}
parameters will depend upon the number of data points configured for the data set. Each is optional (unless a "Required" validator is set for the data point) and will take the default value if not specified.key
).id
property of the data set entries you wish to link to. Note that to remove all links, you must send an empty array for the link property.role
but allows multiple roles to be specified.The JSON result will contain the data object for the row, if there are no errors, in the same structure as the individual row request route. Additionally, if any errors are reported there may be error
and fieldError
properties. If there are no errors, the error properties will not be present.
{
"data": {
"id": number,
"dv": number,
// ... data values
},
"error": string, // General error information
"fieldErrors": [
{
"name": string, // Name of the data point in error
"status": string // Error message
}
]
}
Consider the following being sent to our example data set for flights. It has a string field for the flight name and two links for the departure and arrival airports, in keeping with the example use for the data fetch examples:
curl \
-X POST \
-d key=:apiKey \
-d dp-11=MyFlight \
-d l-5=11 \
-d l-6=3 \
https://ip-or-hostname/io/api/1/dataset/:id
Will result in the following JSON return:
{
"data": {
"id": 27,
"dv": 0,
"dp-11": "MyFlight",
"l-5": [{
"id": 11,
"dp-8": "Aberdeen"
}],
"l-6": [{
"id": 3,
"dp-8": "Bristol"
}]
},
"success":true
}