Path: api/v1/custom/getdata
Method: GET Examples:
/api/v1/custom/GetData?queryname=GetCardFiles&qp1=&pageno=0&pagesize=25
# queryname - The name of the SQL query to execute as per JimWebAPIGetData table
# Format - Set to 0 or 1. Indicates if pagination support (True)
# system - Set to 0 or 1. Indicates if a system script(True) is to be executed or not.
# -- If left out either will be used, with preference given to system if both exist - qp1, qp2 etc . query parameters.
# These are always passesd through to the query as strings, so it is up the SQL to manage conversions (see examples below)
#
#
# Examples (note these examples will only work when system mode is Happen due to security restrictions):
#
# QueryName 'test', Sql 'select * from JimB2BState'
# curl http://localhost/jimtest/api/v1/custom/getdata?queryname=test
#
# QueryName 'test2', Sql 'select * from JimB2BState where State=@qp1 or State=@qp2'
# curl http://localhost/jimtest/api/v1/custom/getdata?queryname=test2?qp1=1?qp2=2
# NOTE: this example has an implicit conversion from the query parameter string to int (State is [int] column).
# For more complex conversions it is up to the SQL to manage the conversion
#
# QueryName 'test3',
# Sql 'select InvNo,CardCode,InvAmt,InvDate
# from JimInv i
# join JimCardFile cf on cf.CardNo = i.CustNo
# where InvNo > CONVERT(int,@qp1);
# select JobNo,CardCode,DateIn
# from JimJob j
# join JimCardFile cf on cf.CardNo = j.CustNo
# where DateDue > CONVERT(DATETIME, @qp2);'
# curl http://localhost/jimtest/api/v1/custom/getdata?queryname=test3?qp1=0?qp2=2020-1-1%2014:00
Further information
Jim2WebAPIGetData System Table
JimScriptUrlHandler System Table