model (get) (post)

The command allows to recover all the records contained within a specific table. Again, the data is sent only if the user has viewing permissions.

It is also possible to add a post to the call in order to filter the records.

Parameters

tablename

Name of the table to be queried

db

Name of the database containing the table

gguid

The global record id (optional)

token

User identification token.

Example

https://web.nios4.com/ws/?action=model&db=db&tablename=customer&token=00000000

Body optional

{

"fields": [ of field names to return, all by default ],

"search": { optional

"fields": [ array of fields on which to search text ],

"query": "string to search in at least one of the specified fields"

},

"conditions": { field/value pairs in AND },

"timerange": { agenda filter, optional

"field_from": "name of the FROM field",

"field_to": "name of the TO field",

"tid_from": start TID,

"tid_to": end TID

},

"order_info": [ ["field name", true for ASC], ... ],

"group_by": [


Reply

{

"error": false,

"records": [

{

"gguid": "g",

"tid": 20191126145027,

"eli": 1,

"arc": 0,

"ut": "user",

"ind": 0,

"gguidp": "",

"exp": "",

"uta": "1070",

"tap": "",

"dsp": "",

"dsc": "",

"dsq1": 0,

"dsq2": 0,

"utc": "user",

"tidc": 20180618182500,

"name": "Customer",

}

],

"total": 1

}

The reply contains all the required records (or the specific one through its global identifier) containing all the values. The records are also filtered based on user permissions.

There is also the total key to quickly identify the number of records returned.