Android
7. Reward List
You can get list reward from goodie by calling Goodie.setRewardList() function. And with this function you can use it to show reward detail. If you fill rewardId parameter with “Empty String”, function will retrieve all reward. And if you want to retrieves specific reward, you can fill rewardId parameter with specific id where you get the Id from previous reward list.
Here is example:
Goodie.setRewardList(authToken, deviceUniqueId, keyword, rewardId, memberId, merchantId, orderBy, orderType, nRecords, page) .rewardListGoodie(mFragment.getActivity(), new SetRewardListListener() { @Override public void onSuccess(RewardListResponse res) { if (res.getAbstractResponse().getResponseStatus().equals("INQ000")) { // on Success } } @Override public void onError(Throwable throwable) { // on Error } });
Where :
Param | Type | Description |
---|---|---|
authToken | String | authToken is used as for header authentication purpose |
deviceUniqueId | String | deviceUniqueId is identify android device |
memberId | String | memberId is identifier that will be used to identity a member |
merchantId | String | merchantId is identifier that will be used to identity a merchant |
keyword | String | keyword is used for filtering specific reward by name. |
rewardId | String | rewardId is used for retrieves all reward or specific reward by Id |
orderBy | integer | It used for filtering reward by name in alphabet. Sample : 1 = Ascending, 2 = Descending |
orderType | Integer | It used for filtering reward by type. Sample : 1 = reward, 2 = product, 3 = point, 4 = expired date |
nRecords | integer | It is used to limit data displayed in one page |
page | integer | It is used to pagination, starts from 0 |
Response Reward List :
{ "rewards":[ { "rewardId":"36B87566-5F48-4142-88CA-7A382B13FDAA", "rewardName":"Reward Invisee", "description":"<p>\n\tVoucher Invisee 100 K dapat diredeem melalui aplikasiInvisee.</p>\n", "termAndCondition":"Syarat dan ketentuan", "requiredPoint":10, "expiredDate":"31/12/2019", "productName":"Voucher Invisee Rp 100.000", "productImage":"https://dev.goodie.id/ViewImage?fileName=uments%5CIndivara%5Cka%23pAVTLKJDuWCESpRTyzaWwSKYoV%24kM.jpg", "productType":"Voucher", "amountValue":100000, "percentageValue":0, "stock":11 }], "recordInfo":{ "totalRecords":2, "page":0, "nrecords":20 }, "abstractResponse":{ "responseStatus":"INQ000", "responseMessage":"Inquiry success" } }