Providing a code snippet as an answer to your inquiry. If you are utilizing WLResourceRequest, the returned response structure will remain consistent. The JSON object received contains various key-value pairs.
The crucial key to look out for is "responseJSON," housing the adapter details you seek. Refer below for accessing this value via the onResponseSuccess function.
Examining the expected object from your query:
{
"userId": 1,
"userName": "username",
"firstName": "firstname",
"lastName": "lname",
"middleInitial": null,
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f8968b93b89f95999194d69b9795">[email protected]</a>",
"dob": -250666200000,
"phoneNo": 2066628405,
"workPhone": null,
"mobileNo": 2036321543,
"status": null,
"address": null,
"group": null
}
var resourceRequest = new WLResourceRequest(
"adapter/path",
WLResourceRequest.GET
);
resourceRequest.send().then(
this.onResponseSuccess,
this.onResponseFailure
);
onResponseSuccess(response) {
var <value> = response.responseJSON.<key>
}
The 'key' and 'value' represent the key-value pairs within the JSON object. Your response object is formatted as follows:
response : {
status : 200,
resonseText : "some long straing that is JSON stringified",
responseJSON: {
"userId" : 1,
"username": "username",
...
"group": null
}
}
To extract the "userId," you would use response.responseJSON.userId