What is Rest API?
A RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data.
...
A RESTful API breaks down a transaction to create a series of small modules. Each module addresses a particular underlying part of the transaction. This modularity provides developers with a lot of flexibility.
How to set up Burti Rest API?
It is necessary to create script in server folder run-burti-web-api-requests.sh
that will contain requests to the server, using the curl
command-line tool:
...
Only describing new options that are not described above:
# {{sort_only
}} - this will use the provided index name as a sort order only, and will not try to look up specific data (used when listing all records within a register)
h4. Insert a new item
{{sample.post.data.txt
}} - made to the WRITE interface {{Web_JSON_UpdatingComposer.hal
}}:{
Code Block |
---|
...
{ |
...
"0": { |
...
"name": "WEB_JSON_INVc_Save.hal", |
...
"company": 2, |
...
"data": { |
...
"action": "insert", |
...
"matrix": [], |
...
"Code": "10101", |
...
"Name": "Media keyboard" |
...
} |
...
}, |
...
"2": { |
...
"name": "WEB_JSON_INVc_Save.hal", |
...
"company": 2, |
...
"data": { |
...
"action": "insert", |
...
"matrix": [], |
...
"Code": "10102", |
...
"Name": "Media keyboard 2" |
...
} |
...
} } |
h5. Parameters explained
As you can see, the request is now in JSON format. It is once again numbered and can contain multiple requests within the single call. These would be expected to be numbered 0, 1, 2 and so on.
...