Hi,
My apologies for having posted this twice. There was an issue with the
last thread, and I guess the only way to correct it was to delete the
whole thread.
So I'm down to 2 days left in order to make the case for WINDEV Mobile
and recommend to IT that we purchase with the 40% discount. I will try
to be as clear as possible.
I am new to WINDEV Mobile. Zero experience. I have a very simple
prototype that only needs to have 4 to 5 windows completed for me to
show IT. I am using Express.
Basically I'm using an undocumented API (no API Spec File), hand written
by the IT department. But it works just fine in my tests using Swagger
Inspector. I'm using the following on a login window to access the API,
authenticate, and get the token:
NOTE: The link to the API below is not real. Didn't think that was a
good idea for a public forum. But the methods are real.
req is restRequest req..URL =
"https://example.dev.com/mobile-app/folder/web-service/mobile-api.php?method=ms1&email=[%EDT_Email%]"
resp is restResponse = RESTSend(req) Jrec is Variant =
JSONToVariant(resp.Content) IF Jrec[1] = 0 THEN
sEmailaddrEXPRESSEXPRESSEXPRESS is string = Jrec[2] ELSE
ToastDisplay("invalid email")
RETURN
END
req..URL =
"https://example.dev.com/mobile-app/folder/web-service/mobile-api.php?method=ms2&email=[%EDT_Email%]&password=[%EDT_Password%]"
resp = RESTSend(req) Jrec = JSONToVariant(resp.Content) IF Jrec[1] = -1
THEN
ToastDisplay("invalid Password")
RETURN
END
gsToken = Jrec[2]
I can then use that token to populate a table control on the next window
using the following local procedure:
req is restRequest
req..URL =
"https://example.dev.com/mobile-app/folder/web-service/mobile-api.php?method=card-list&token=[%gsToken%]"
resp is restResponse = RESTSend(req) Jrec is Variant =
JSONToVariant(resp.Content)
array or at least to the table (don't have to do both)
the jrec variant
FOR EACH lrec OF Jrec
TableAddLine(TABLE_List1,lrec.card_last_4,lrec.cardholder,lrec.period_avail,lrec.card_status)
END
gsCard_secure_ssl = Jrec[2]
All of this seems to work fine. The trouble I'm having is that the data
returned is a list of users (cardholders). I need to be able to select a
user, and then populate the next window with that user's specific data.
(send their records to a new window)
The data for this next window (which is a Looper Control) needs to be in
a single column (maybe 2 columns for the 1st row) with 6 to 8 rows of
selectable data, which will then need to go to a new window once selected.
Here is the Looper Window local procedure:
PROCEDURE Init()
req is restRequest
req..URL =
"https://example.dev.com/mobile-app/folder/web-service/mobile-api.php?method=stats&token=[%gsToken%]&card=[%gsCard_secure_ssl%]"
resp is restResponse = RESTSend(req) Jrec is Variant =
JSONToVariant(resp.Content)
array or at least to the table (don't have to do both)
the jrec variant
FOR EACH lrec OF Jrec
LooperAddLine(LOOP_Content,lrec.card_last_4,lrec.cardholder,lrec.decline,lrec.pending,lrec.posted)
END
There is a second token "gsCard_secure_ssl" needed to pull in specific
cardholder data. I may not have coded this correctly, because the Looper
window is blank. If I use a Multiline Zone instead of a Looper, I at
least get values of "0" returned. Not sure what that means.
If someone could help me with this issue, I might be able to use that
for all subsequent record pulls. I'm so close!!!
Thanks so much!!!