Android Question How to modify api link to pass parameters

Makumbi

Well-Known Member
Licensed User
Please help i have this API URL which returns this
B4X:
[{"Account":"19-07561","Expressed":"END TERM 1 2019"},{"Account":"19-07561","Expressed":"END TERM 2 2019"},{"Account":"19-07561","Expressed":"END TERM 2 2020"},{"Account":"19-07561","Expressed":"END TERM 3 2019"},{"Account":"19-07561","Expressed":"END TERM 3 2020"},{"Account":"19-07561","Expressed":"MID TERM 1 2019"},{"Account":"19-07561","Expressed":"MID TERM 1 2020"},{"Account":"19-07561","Expressed":"MID TERM2 2019"},{"Account":"19-07561","Expressed":"MID TERM3 2019"},{"Account":"19-07780","Expressed":"END TERM 2 2020"},{"Account":"19-07780","Expressed":"END TERM 3 2020"},{"Account":"19-07780","Expressed":"MID TERM 1 2020"},{"Account":"19-07781","Expressed":"END TERM 3 2020"},{"Account":"99-00004","Expressed":"END TERM 2 2020"},{"Account":"99-00004","Expressed":"END TERM 3 2020"},{"Account":"99-00004","Expressed":"MID TERM 1 2020"}]

This is my API URL that has two parameters Please help how can i modify it using B4x
B4X:
http://localhost:5216/KABOJJAAPPAPI/api/HandlerVBLoadterm/GetCustomersJSON/0782911364/Father

How can i modify this code
B4X:
Dim Subscriptiondetailsm As Map
    Subscriptiondetailsm.Initialize
    Subscriptiondetailsm.put("Type","Father")
    Subscriptiondetailsm.put("Phone","0782911364")
   
    Dim json As JSONGenerator
    json.Initialize(Subscriptiondetailsm)
    Dim contentr As String = json.ToString
    'Depends on okHttputils library
    Dim clientb As HttpJob
    clientb.Initialize("",Me)
    clientb.PostString("http://localhost:5216/KABOJJAAPPAPI/api/RecieveSMS",contentr)
    clientb.GetRequest.SetContentType("application/json")    'set the header as json
    clientb.GetRequest.SetContentEncoding("UTF8")
           
    Wait For Jobdone(clientb As HttpJob)
   
    If clientb.Success Then
        Dim Resultd As String = clientb.GetString
        Dim data As JSONParser
        data.Initialize(Resultd)
        '
        'Dim product As Map = data.NextObject
    End If
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…