To read one record, you must have right to the data and use the maindata url to fetch them using a http GET command. The format of the url is; /maindata/tablename/recno/?dataeasequery1&othersettings=val1&othersetting2=val2 etc.

/maindata/ tells the server to give you one record of the selected table. 

/tablename/ tells what table to fetch the data.

/recno/ tells the record to fetch based in the query.

The query format is the same as for any other query in server. The first part between ? and the first & is a query as your write it in DataEase. This mean you can write a Name="A*" to get all records with a text field starting on A. You can also use all other operators like AND, OR, BETWEEN, >, >=, <, <=, =, not = etc. So if you want a record where Name starts on A and regdate is between to dates your write "Name="A*" AND regdate between 10/10/20 to 12/10/20". If you want to get the results in acending or decending order based on a field, you add this as "&regdate=in order".

Ex. /maindata/Address/0/?Name="A*" AND regdate between 10/10/20 to 12/10/20&regdate=in order&jsonpretty=1&getrecordcount=1

This query will return the first record matching Name="A*" and reg date between the 10/10/20 and 12/10/20 in acending order on regdate is formatted json and also add the number of record matched. Then the first or these are returned to the user.

Extra query parameters that can me used to manipulate the result can be found here.

Set default values on new record

When doing a GET new record (-1) you can use the query values to set field default to internal datastore before read. That is if you have a value that i not fixed but set by some calculation done in your web page, you can do a ?&fieldname=myval to set it as a default value.

Format returned from query

The return format is application/json with the following format:

When no error occurred:
{
	'result' : 'ok',
	'recorddata' : {
		'Name' : 'Bjorn',
		'Country' : 'Norway',
		'Street' : 'Narrow street',
		'Postno' : '1234',
		'PostAddr' 'Somewhere'
	},
	'recno' : '0'
}
When error occurred
{
	"errormsg" : "no record matching query"
	"result" : "error",
}
When not sufficient right to table
{
	"message":"Not logged in and default rights not sufficient.",
	"result":"forbidden"
}

If the default security is not set or the user is not logged in with sufficient right to the table, you will get "forbidden" as the result of the query.