Support > Wagby Developer Network(R7) > REST API usage guide > Search/Get ​​list data
ja | en

Search results are held by the server, and results can be obtained on a page basis.

It is a method of specifying the search condition by parameter.

URL Example

http://localhost:8921/wagby/rest/customer/list?customer_cp$002fname=Suzuki

response

Here is an example of the content of the return.

{
 "result": {
   "size": 1,
   "next": 1,
   "current": 1,
   "nextPage": false,
   "prevPage": false
 },
 "errors": {
   "jfcinfo": [],
   "jfcwarn": [],
   "jfcdebug": [],
   "jfcerror": []
 },
 "status":"ShowListCustomerController.input",
 "entity": [
   {
     "customerid_": 1000,
     "name_": "Suzuki",
     "email_": []
   }
 ],
 "listp": {
   "sortable_": "customerid",
   "sort_": "",
   "order_": "",
   "item_": [
     {
       "customerid_":"1000",
       "name_":"Suzuki"
     }
   ]
 },
 "conditionp": {
   "name_": {
     "content_":"Suzuki",
     "formatted_": null,
     "errorcode_":""
   }
 }
}
@RequestMapping(value="/rest/[modelid]/list", method=POST, headers={"Content-Type=application/x-www-form-urlencoded"})

Parameters

Specify the same parameters as the form screen as POST.
Example:
customer_cp$002fname=Suzuki

response

It is similar to "$ {content_ 0 _ name}".

@RequestMapping(value="/rest/[modelid]/list", method=POST, headers={"Content-Type=application/json"})

HTTP header

Content-Type:application/json

Request description

Specifies the JSON representation of the presentation object of the condition.

{
   "name_": {
     "content_":"Suzuki"
   }
}

Handling of choose attribute

Items prepared as checkboxes are given a choose attribute in their choices. When including this in the search condition, change the choose attribute totrueTo the server.

{
  "jgroupid_": [
    { 
    "id_": "1000",
    "choose_":true
    }
  ]
}

response

It is similar to "$ {content_ 0 _ name}".

@RequestMapping(value="/rest/[modelid]/list/next", method=GET)

response

It is similar to "$ {content_ 0 _ name}".

@RequestMapping(value="/rest/[modelid]/list/prev", method=GET)

response

It is similar to "$ {content_ 0 _ name}".

@RequestMapping(value="/rest/[modelid]/list/first", method=GET)

response

It is similar to "$ {content_ 0 _ name}".

@RequestMapping(value="/rest/[modelid]/list/last", method=GET)

response

It is similar to "$ {content_ 0 _ name}".

@RequestMapping(value="/rest/[modelid]/jump/last", method=GET)

response

It is similar to "$ {content_ 0 _ name}".

@RequestMapping(value="/rest/[modelid]/changeSizePerPage", method=POST, headers={"Content-Type=application/x-www-form-urlencoded"}, params="__jfc_size_per_page")

Parameters

ParametersDescription
__jfc_size_per_pageNumber per page

response

It is similar to "$ {content_ 0 _ name}".

Using the request parameter

The control parameters that can be assigned to the search parameters are as follows.

ParametersDescription
pagesizejshparamNumber of acquisitions
firstresultjshparamStart count
sortkeyjshparamSort key

Example 1:
When firstresultjshparam = 0 is set, retrieve from the top of the search result up to the number of "display on page" in the list display.

Example 2:
When firstresultjshparam = 10 is set, from the tenth search result, up to the number of "display number on page" in the list display is acquired.

Example 3:
If you set pagesizejshparam = 100 & firstresultjshparam = 10, we will retrieve the 10th to 110th search results.

Example 4:
If you specify sortkeyjshparam = customerid: DESC, you get the result of sorting customerid items in descending order.

Using JSON objects

For JSON objects, it looks like this:

ParametersDescription
pagesizeNumber of acquisitions
firstresultStart count
sortkeySort key

Example:

{
       "pagesize": 100,
       "firstresult": 10,
       "sortkey": "customerid:DESC"
}