Get Journey Details – GBG IDscan Documentation

Get Journey Details

If you are interested in retrieving aggregated results about your journey, you can use the retrieval function called getJourney(). First, we need EnterpriseService instance.

For retrieving, create listener OnGetJourneyListener.

Java:

getJourney()
EnterpriseService enterprise = new EnterpriseService(getApplicationContext());
enterprise.setBaseUrl(“https://baseUrl.idscan.cloud/”);
enterprise.getJourney("JourneyID",
                      new Credentials("user","password"),
                      mGetJourneyListener);

For for kotlin example best would be to reuse Enterprise Service instance we created before.

Kotlin:

getJourney() 
enterpriseService?.getJourney(journeyID, onGetJourneyListener = journeyListener)

Callback of getJourney() us OnGetJourneyListner:

Java

// Response of get details (Retrieval)
private OnGetJourneyListener mGetJourneyListener = new OnGetJourneyListener() {
    @Override
    public void onGetJourney(@Nullable ResponseJourney responseJourney) {}
 
    @Override
    public void onError(int code, @NonNull String message) {}
};

Kotlin

private val mGetJourneyListener = object : OnGetJourneyListener {
        override fun onGetJourney(responseJourney: ResponseJourney?) {
            // Succesfull response about journey
        }
 
        override fun onError(code: Int, message: String) {
            when (code) {
                // Example code for handling issues.
                EnterpriseService.EXCEPTION_SERVER_UNREACHABLE -> mView.showRetryDialog(R.string.progress_server_unreachable_title)
                EnterpriseService.EXCEPTION_TIMEOUT -> mView.showRetryDialog(R.string.progress_timeout_title)
                else -> mView.finishWithError(code, message, mJourneyID)
            }
        }
    }

Possible onError() codes:

CodeDescription
EnterpriseService.EXCEPTION_ERRORReturns when Web service experienced unrecoverable situation and returns localised exception message.
EnterpriseService.EXCEPTION_SERVER_UNREACHABLEHost unreachable – bad URL or no internet connection.
EnterpriseService.EXCEPTION_TIMEOUTWeb client time out.
500Internal server error, more information on server side. 
408Server time out.
401Unauthorized, possibly bad credentials. 
400Bad Request.
Other error HTTP status codes possible:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

For more information, check JavaDocs on possible call exceptions.

Was this page helpful?