*DO (LOWER(JUSTPATH(sys(16))) + "\http_ppgm") WITH "https://canteen-backend.alto-testing.mine.nu/"

*DO (LOWER(JUSTPATH(sys(16))) + "\http_ppgm") WITH "https://bakare-backend.alto-testing.mine.nu/"
*DO (LOWER(JUSTPATH(sys(16))) + "\http_ppgm")  WITH "https://marina-backend.alto-testing.mine.nu/"
*DO (LOWER(JUSTPATH(sys(16))) + "\http_ppgm") WITH "https://datastore-rezervace-novy.alto-testing.mine.nu/"
*DO (LOWER(JUSTPATH(sys(16))) + "\http_ppgm") WITH "https://aquaspindl-backend.alto-testing.mine.nu/"
DO (LOWER(JUSTPATH(sys(16))) + "\http_ppgm") WITH "https://admin:admin@canteen-adient-backend.alto-production.mine.nu/"


HTTP_READ_ONLY_MODE = .T.



json = ""


json = http_get("kredit/crud/clients?page_size=99")
json = http_get("auth/client_by_card?card_number=10000")
json = http_get("kredit/crud/clients?filter{chip_id}=8E25C24E")

json = http_get("kredit/crud/transactions?page_size=99")

RETURN 

*json = http_get("rezervace/crud/events?filter{start_at.gte}=2017-11-01")

*json = http_get("rezervace/crud/registrations?filter{event}=775&filter{confirmed}=true")
*json = http_get("rezervace/crud/registrations?filter{confirmed}=true")

*json = http_get("rezervace/crud/products")

*c_karty = 132600
*json = http_get("rezervace/crud/products?filter{card_number}=" + ALLTRIM(STR(m.c_karty,13)))

*json = http_get("kredit/crud/clients")

*/kredit/crud/clients?filter{chip_id}=123456 

*json = http_get("kredit/crud/client_infos?filter{client}=356")


*json = http_get("kredit/crud/client_infos")
*json = http_get("kredit/crud/clients")
*json = http_get('kredit/crud/clients?filter{personal.icontains}="F"')
*STRTOFILE(beautify_json(m.json), ".\json_clients.txt")
*json = http_get("bakare/crud/vouchers")
*json = http_get("kredit/crud/transactions")
*json = http_get("bakare/crud/actions")
*? beautify_json(json)

*? http_request("bakare/crud/vouchers/28", "PATCH", '{"sent_to":"pepanovak@seznam.cz", "bill_number":"", "spent_at":null, "spent_value":0.00}')
*? http_request("bakare/crud/vouchers/29", "PATCH", '{"sent_to":"jananovak@seznam.cz", "bill_number":"CD54711", "spent_at":"2017-11-05T03:12", "spent_value":360.00}')
*? http_request("bakare/crud/vouchers/28", "PATCH", '{"sent_to":"milan@seznam.cz", "bill_number":"0554321", "spent_at":"2017-11-25T00:12", "spent_value":300.00}')
*? http_request("bakare/crud/vouchers/29", "PATCH", '{"sent_to":"jan@seznam.cz", "bill_number":"0184321", "spent_at":"2017-11-25T00:12", "spent_value":200.00}')


*? http_request("kredit/crud/clients/5", "PATCH", '{"personal":{"sex":"M","phone":123456789,"phone2":null,"birth_date":"1969-11-11"} }')
*? http_request("kredit/crud/clients/5", "PATCH", '{"email":"sx@sex.cz"} ')
*? http_request("kredit/crud/clients",   "POST", '{"client_id":"119", "card_id":"119"} ')
*? http_request("kredit/crud/clients",   "POST", '{"client_id":"229", "card_id":"229"} ')
*? http_request("kredit/crud/clients",   "POST", '{"client_id":"889", "card_id":"889"} ')
*? http_request("kredit/crud/clients",   "POST", '{"client_id":"998", "card_id":"998"} ')


? beautify_json(json)

retu


*!*       radek = '{"client": "' + '4' + '", "kind": "' + "POI" + '", "amount": ' + "45" + ', "balance": ' + "203.45" +  + ', "transacted_at": "' + "2017-05-19T12:13:16" + '", "description": "' + "zkouska 1" + '"}'
*!*       ? m.radek
*!*       json = http_request("kredit/crud/transactions", "POST", m.radek)
*!*    ? beautify_json(json)

*!*    ? http_request("kredit/crud/transactions", "POST", '{"client": "' + '2' + '", "kind": "' + "POI" + '", "amount": ' + "-45" + ', "balance": ' + "-353.45" +  + ', "transacted_at": "' + "2017-04-13T12:13:16" + '", "description": "' + "zkouska 1" + '"}')
*!*    ? http_request("kredit/crud/transactions", "POST", '{"client": "' + '2' + '", "kind": "' + "POI" + '", "amount": ' + "-15" + ', "balance": ' + "-353.45" +  + ', "transacted_at": "' + "2017-07-13T12:13:16" + '", "description": "' + "zkouska 1" + '"}')
*!*    ? http_request("kredit/crud/transactions", "POST", '{"client": "' + '3' + '", "kind": "' + "POI" + '", "amount": ' + "-25" + ', "balance": ' + "-353.45" +  + ', "transacted_at": "' + "2017-02-13T12:13:16" + '", "description": "' + "zkouska 1" + '"}')
*!*    ? http_request("kredit/crud/transactions", "POST", '{"client": "' + '3' + '", "kind": "' + "POI" + '", "amount": ' + "-35" + ', "balance": ' + "-353.45" +  + ', "transacted_at": "' + "2017-03-13T12:13:16" + '", "description": "' + "zkouska 1" + '"}')

*json = http_get("kredit/crud/transactions")
*STRTOFILE(beautify_json(m.json), ".\json_trans.txt")
*? beautify_json(json)


*json = http_get("kredit/clients/with_transaction_sums?kind=POI&start=2016-04-04T00:00&end=2017-09-21T12:33&min_sum=9")
*? beautify_json(json)


*json = http_get("kredit/clients/with_transaction_sums?kind=POI&start=2016-04-04T00:00&end=2017-09-21T12:33&max_sum=2000")
*? beautify_json(json)


*json = http_get("kredit/crud/client_info")
*json = http_get("kredit/crud/clients?filter{status}=A")
*? beautify_json(json)

*? http_request("kredit/crud/clients/7", "PATCH", '{"personal":{"sex":"M","phone":null,"phone2":null,"birth_date":"1969-09-02"} }')

*? http_request("kredit/crud/client_infos", "POST", '{"client":7, "typ": "C" }')
*? http_request("kredit/crud/client_infos", "POST", '{"client":8, "typ": "J" }')

*json = http_get("kredit/crud/clients?include[]=info.*")
*json = http_get("kredit/crud/clients?filter{updated_at.gt}=2017-10-09")
*json = http_get("kredit/crud/client_infos")
*? beautify_json(json)
*natahni_klienty()

*json = http_get("kredit/crud/vouchers")
*? m.json
*oznam_hotovo()


