getMyCarePathAccessUrl

abstract suspend fun getMyCarePathAccessUrl(section: MyCarePathSection? = null): String

Retrieves the personalized MyCarePath access URL.

Return

A String with the MyCarePath access URL. Empty only when the backend responds without a URL - never as a stand-in for a failed request.

Parameters

section

An optional section to deep link into. See com.advantahealth.api.mycarepath.model.MyCarePathSection for available sections.

Throws

if the request fails.

Android (Kotlin)

lifecycleScope.launch {
try {
val url = AFCore.myCarePath().getMyCarePathAccessUrl(MyCarePathSection.COURSES)
if (url.isNotEmpty()) {
openInWebView(url)
} else {
showError("Could not retrieve MyCarePath URL")
}
} catch (t: Throwable) {
showError("Failed to load MyCarePath: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let url = try await AFCore.shared.myCarePath().getMyCarePathAccessUrl(section: .courses)
if !url.isEmpty {
self.openInWebView(url)
} else {
self.showError("Could not retrieve MyCarePath URL")
}
} catch {
self.showError("Failed to load MyCarePath: \(error.localizedDescription)")
}
}

abstract suspend fun getMyCarePathAccessUrl(pageId: String): String

Retrieves the personalized MyCarePath access URL for a tenant-configured page.

Unlike the MyCarePathSection overload, the target page is identified by a page-id string that is tenant configuration, not a fixed catalog value. Tenants publish these ids in their application settings (the myCarePathPages map, e.g. the wellnessChallenges, liveCoachingLearnMore, and liveCoachingSignUp entries); pass the configured value through verbatim.

Return

A String with the MyCarePath access URL. Empty only when the backend responds without a URL - never as a stand-in for a failed request.

Parameters

pageId

The tenant-configured MyCarePath page id, forwarded verbatim as the redirect query parameter. For the member's default dashboard URL call getMyCarePathAccessUrl() with no argument (non-null here, so a 1.11 call getMyCarePathAccessUrl(null) still resolves to the section overload).

Throws

if the request fails.

Android (Kotlin)

lifecycleScope.launch {
try {
val url = AFCore.myCarePath().getMyCarePathAccessUrl(pageId = wellnessChallengesPageId)
if (url.isNotEmpty()) {
openInWebView(url)
} else {
showError("Could not retrieve MyCarePath URL")
}
} catch (t: Throwable) {
showError("Failed to load MyCarePath: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let url = try await AFCore.shared.myCarePath().getMyCarePathAccessUrl(pageId: wellnessChallengesPageId)
if !url.isEmpty {
self.openInWebView(url)
} else {
self.showError("Could not retrieve MyCarePath URL")
}
} catch {
self.showError("Failed to load MyCarePath: \(error.localizedDescription)")
}
}