[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Sending JSON POST query using ABL

Status
Not open for further replies.
P

Peter Judge

Guest
You'll have to add a bit more code for that JSON structure. If you indent it { "UPSSecurity" : { "UsernameToken" : { "Username" : "username" , "Password" : "password" }, "ServiceAccessToken" : { "AccessLicenseNumber" : "accesstoken" } }, "ShipmentRequest" : { "Request" : { "RequestOption" : "validate" , "TransactionReference" : { "CustomerContext" : "Your Customer Context" } } } } For the username/token part, you'll have to do something like this. I check the contents of my JSON objects when I'm developing them by dumping them to disk jsonEntity:WriteFile(sessioN:temp-dir + 'data.json', yes). // the yes is to pretty-print the data jsonEntity = new JsonObject(). jsonData = new JsonObject(). jsonEntity:Add('UPSSecurity', jsonData). jsonDetail = new JsonObject(). jsonData:Add('UsernameToken', jsonDetail). jsonDetail:Add('Username', 'username'). jsonDefailt:Add('Password', 'password'). jsonDetail = new JsonObject(). jsonData:Add('ServiceAccessToken', jsonDetail). jsonDetail:Add('AccessLicenstNumber', 'accesstoken'). jsonData = new JsonObect(). jsonEntity:Add('ShipmentRequest, jsonData). // etc

Continue reading...
 
Status
Not open for further replies.
Top