Class DocScanClient

java.lang.Object
com.yoti.api.client.docs.DocScanClient

public class DocScanClient extends Object
Client used for communication with the Yoti Doc Scan service

The DocScanClient facilitates requests to the Yoti Doc Scan service

  • Method Details

    • builder

      public static DocScanClient.Builder builder()
    • createSession

      public CreateSessionResult createSession(SessionSpec sessionSpec) throws DocScanException
      Creates a Doc Scan session using the supplied session specification
      Parameters:
      sessionSpec - the Doc Scan session specification
      Returns:
      CreateSessionResult the session creation result
      Throws:
      DocScanException - if an error has occurred
    • getSession

      public GetSessionResult getSession(String sessionId) throws DocScanException
      Retrieves the state of a previously created Yoti Doc Scan session
      Parameters:
      sessionId - the session ID
      Returns:
      GetSessionResult the session state
      Throws:
      DocScanException - if an error has occurred
    • deleteSession

      public void deleteSession(String sessionId) throws DocScanException
      Deletes a previously created Yoti Doc Scan session and all of its related resources
      Parameters:
      sessionId - the session ID
      Throws:
      DocScanException - if an error has occurred
    • getMediaContent

      public Media getMediaContent(String sessionId, String mediaId) throws DocScanException
      Retrieves media related to a Yoti Doc Scan session based on the supplied media ID
      Parameters:
      sessionId - the session ID
      mediaId - the media ID
      Returns:
      Media the media
      Throws:
      DocScanException - if an error has occurred
    • deleteMediaContent

      public void deleteMediaContent(String sessionId, String mediaId) throws DocScanException
      Deletes media related to a Yoti Doc Scan session based on the supplied media ID
      Parameters:
      sessionId - the session ID
      mediaId - the media ID
      Throws:
      DocScanException - if an error has occurred
    • putIbvInstructions

      public void putIbvInstructions(String sessionId, Instructions instructions) throws DocScanException
      Sets the IBV instructions for the given session
      Parameters:
      sessionId - the session ID
      instructions - the instructions
      Throws:
      DocScanException - if an error has occurred
    • getIbvInstructionsPdf

      public Media getIbvInstructionsPdf(String sessionId) throws DocScanException
      Fetches the instructions PDF associated with an In-Branch Verification session.
      Parameters:
      sessionId - the sessionID
      Returns:
      the PDF media
      Throws:
      DocScanException - if an error has occurred
    • fetchInstructionsContactProfile

      public ContactProfileResponse fetchInstructionsContactProfile(String sessionId) throws DocScanException
      Fetches the associated instructions contact profile for the given In-Branch Verification session
      Parameters:
      sessionId - the session ID
      Returns:
      the contact profile
      Throws:
      DocScanException - if an error has occurred
    • createFaceCaptureResource

      public CreateFaceCaptureResourceResponse createFaceCaptureResource(String sessionId, CreateFaceCaptureResourcePayload createFaceCaptureResourcePayload) throws DocScanException
      Creates a Face Capture resource, that will be linked using the supplied requirement ID
      Parameters:
      sessionId - the session ID
      createFaceCaptureResourcePayload - the CreateFaceCaptureResourcePayload
      Returns:
      the response
      Throws:
      DocScanException - if an error has occurred
    • uploadFaceCaptureImage

      public void uploadFaceCaptureImage(String sessionId, String resourceId, UploadFaceCaptureImagePayload uploadFaceCaptureImagePayload) throws DocScanException
      Uploads an image to the specified Face Capture resource
      Parameters:
      sessionId - the session ID
      uploadFaceCaptureImagePayload - the Face Capture image payload
      Throws:
      DocScanException - if an error has occurred
    • getSupportedDocuments

      public SupportedDocumentsResponse getSupportedDocuments(boolean includeNonLatin) throws DocScanException
      Gets a list of supported documents.
      Parameters:
      includeNonLatin - the includeNonLatin flag
      Returns:
      the supported documents
      Throws:
      DocScanException - if an error has occurred
    • getSupportedDocuments

      public SupportedDocumentsResponse getSupportedDocuments() throws DocScanException
      Gets a list of supported documents only with latin documents.
      Returns:
      the supported documents
      Throws:
      DocScanException - if an error has occurred
    • getIbvInstructions

      public InstructionsResponse getIbvInstructions(String sessionId) throws DocScanException
      Fetches any currently set instructions for an IBV session.
      Returns:
      the instructions
      Throws:
      DocScanException - if an error has occurred
    • triggerIbvEmailNotification

      public void triggerIbvEmailNotification(String sessionId) throws DocScanException
      Triggers an email notification for the IBV instructions at-home flow. This will be one of: - an email sent directly to the end user, using the email provided in the ContactProfile - if requested, a backend notification using the configured notification endpoint
      Parameters:
      sessionId - the session ID
      Throws:
      DocScanException - if an error has occurred
    • getSessionConfiguration

      public SessionConfigurationResponse getSessionConfiguration(String sessionId) throws DocScanException
      Fetches the configuration for the given sessionID.
      Parameters:
      sessionId - the session ID
      Returns:
      the session configuration
      Throws:
      DocScanException - if an error has occurred