Creates one or more new file records.
GET: api/v1/<apiresource>/crud/<filename>
•<apiresource> ApiResource name. e.g. apidemo.
•<filename> Name of the file on which the operation is performed. e.g. LK.CUSTOMERS
•{id} Parameter. Code of the record to be read. e.g. api/v1/apidemo/crud/LK.CUSTOMERS/10
Select operation has 2 more variants: DICTIONARIES and SCHEMA. The difference between the 3 variants is in how the results are displayed.
Input and output parameters are the same in all 3 variants, and the differences are present only when records have multivalues.
For more information, see Response section below.
GET (DICTIONARIES mode): api/v1/<apiresource>/crud/dict/<filename>
GET (SCHEMA mode): api/v1/<apiresource>/crud/sch/<filename>
Parameters
new_id |
string |
Can be empty, in that case the registration is created with the code defined in the request body. •LINKAR. The creation options of the Linkar type code. Following options can be used: prefix, separator, prefix_format_spec. •RANDOM. The creation options of the Random type code. Following options can be used: numeric, length. •CUSTOM. Customized code creation. |
prefix |
string |
Only when new_id = LINKAR. Adding a prefix to the code. |
separator |
string |
Only when new_id = LINKAR. . The separator between the prefix and the code. The allowed separators list is: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ |
prefix_format_spec |
string |
Only when new_id = LINKAR. The code format, under the database syntax. |
numeric |
boolean |
Only when new_id = RANDOM. Indicates if the code must be numeric. |
length |
integer |
Only when new_id = RANDOM. Indicates if the code must be numeric. |
read_after |
boolean |
Reads the record again and returns it after its creation. The calculated, dictionaries, conversion, format_spec and original_record options, will only be effective if this option is true. |
calculated |
boolean |
Return the resulting values from the calculated dictionaries. |
conversion |
boolean |
Execute the defined conversions in the dictionaries before returning. |
format_spec |
boolean |
Execute the defined formats in the dictionaries before returning |
original_record |
boolean |
Return a copy of the records in MV format. |
custom_vars |
string |
This is a free text field to send in the transaction. If not empty, subroutine SUB.LK.MAIN.CONTROL.CUSTOM will be called. Add custom code to that subroutine to define special behaviours for some or all transactions. |
svr_timeout |
integer |
This is the maximum time in seconds that the client will wait for a response. Use 0 for no timeout. |
(*) Mandatory
Request Body
application/json
The entry record has the following structure:
In this example we have LK.CUSTOMERS file with dictionaries for its 3 attributes. Thats why the names of the dictionaries are displayed (NAME, ADDR and PHONE), otherwise only LKITEMID would be displayed.
To define each attribute, new nodes have to be added with the name LKFLDn, where n is the number of the attribute.
application/xml
The entry record has the following structure:
In this example we have LK.CUSTOMERS file with dictionaries for its 3 attributes. Thats why the names of the dictionaries are displayed (NAME, ADDR and PHONE), otherwise only LKITEMID would be displayed.
To define each attribute, new nodes have to be added with the name LKFLDn, where n is the number of the attribute.
text/plain
The entry record has the following structure:
In this structure, there are two main blocks separated by the FS character (ASCII 28). The first part is the list of records IDs and the second one is the list of records MV buffer.
In case of being more than one element in any of the two lists, they must be separated with each other with the RS character (ASCII 30).
The MV buffers are the records as is, with attribute (AM), multivalue (VM) and subvalue (SM) marks.
Responses
There are 3 different ways of displaying the results. In JSON,XML formats and plain text (LkString). However, the response will always be displayed in the same format of the request body sent. This means that if the request body was in JSON format, the results will be displayed in JSON, regardless of the Media Type value selected for the response.
On all kind of responses, an ERROR tag will list all possible errors during execution of the operation. This tag includes CODE tag with the error codes and MESSAGE tag with messages of each error.
In responses of type "text/plain" (LkString MV), error codes and messages are separated by multivalue marks.
application/json
The image below shows the usual response when the application/json is selected as Media Type. The response can have multiple variants.
For more information, click here.
application/xml
The image below shows the usual response when the application/xml is selected as Media Type. The response can have multiple variants.
For more information, click here.
text/plain
Response is displayed in text format. This response is a chain of characters structured in sections, named LkString. For more information about the different tags in this response, click here.