Making API Requests
At this point, we can start making secure API requests to the Falcon backend. All FD Management APIs can be accessed using the FalconSecureSDK.request()
function. The actionCode represents the API to call and the payload contains the request data. The shape of the payload object is specific to each action. The next pages in the documentation contain details of the payload needed for each action code.
Params
Name | Type | Description |
---|---|---|
actionCode | String | Every request to the Falcon Bankend is represented by an action code. For example: CHECK_USER. Refer to the "Action Codes" page of the docs to find a list of all action codes and their respective payloads. |
payload | Map<String, Object> | This map contains the unencrypted payload specific to the given action code |
bank | String | This is the issuing bank's name |
userId | String (Optional) | UserID of the current user (All requests except CHECK_USER need userId) |
pan | String (Optional) | PAN number of the user (Needed for CHECK_USER for de-dup check) |
mobileNumber | String (Optional) | Mobile Number of the current user (Needed for CHECK_USER for de-dup check) |
callback | ApiUtils.Callback | Callback to handle the response |
Sample
import com.falconfsauth.sdk.FalconSecureSDK;
import com.falconfsauth.sdk.Utils.ApiUtils;
import java.util.HashMap;
import java.util.Map;
Map<String, Object> payload = new HashMap<>();
// Add key-value pairs to the Map
payload.put("key", "value")
FalconSecureSDK.request(actionCode, payload, bank, userId, pan, mobileNumber, new ApiUtils.Callback<String>() {
@Override
public void onSuccess(String response, Integer responseCode) {
// Handle success
}
@Override
public void onError(Exception e) {
// Handle error
}
});
Response
Name | Type | Description |
---|---|---|
response | String | JSON String with the response |
Updated 4 months ago