Legal Documents
SDK introduces LegaDocuments service for fetching and submitting user consent.
getLegalDocuments
Fetches a collection of currently active legal documents.
Optional languageTag language tag (e.g., "en", "fr-CA"). If null or blank, the backend default localization is applied.
Parameters:
userProfileId: The ID is available in activation or user call
Concrete Example
let service = LegalDocumentsService()
service.getLegalDocuments(
userProfileId: userProfileId,
then: { result in
switch result {
case: .success(_)
// successfully retrieved
case: .failure(_)
// failure error
}
})val service = LegalDocumentsService()
service.getLegalDocuments(userProfileId) { result: Result<List<LegalDocumentsCollection>> ->
if (result?.value == null || result.throwable != null) {
// failure
} else {
// Success
val content = result.value
}
})getLegalDocumentContent
Fetches the full content for a specific legal document.
Parameters:
documentId: The document ID that is available in the previous call. (when the list of documents is fetched)userProfileId: The ID is available in activation or user call
To get the specific legal document, first host app needs to retrieve the documentId provided when the getLegalDocuments API call is made and need to provide the retrieved documentId as an argument to submitConsent API
Concrete Example
submitConsent
Submits user consent for a specific legal document.
Parameters:
documentId: The document ID that is available in the previous call. (when the list of documents is fetched)userProfileId: The ID is available in activation or user call
To submit the user consent, first host app needs to retrieve the documentId provided when the getLegalDocuments API call is made and need to provide the retrieved documentId as an argument to submitConsent API
Concrete Example
Last updated