Skip to main content

Platform Extensions

Geo Location

The Quickplay Platform determines user's geo-location based on incoming client IP. To access the platform determined geo location info, use the following extension API

val locationResult = PlatformCoreExtensions.getGeoLocation(
"https://<host>",
platformAuthorizer,
queryParams
)

if (locationResult is Result.Success) {
val countryName = locationResult.value.countryName
} else if(locationResult is Result.Failure) {
val error = locationResult.value
logger.warn { "Failed to acquire location info: $error" }
}

Adobe Primetime - FLAT Token

To generate a Quickplay Access Token (FLAT) for TVE flows via Adobe Primetime, use the below extension API by passing the following info:

NameTypeRequiredDescription
deviceIdStringRequiredUnique device identifier. Refer to Secure Playback for generating a unique device id.
deviceInfoStringRequiredBase64 encoded Device Info. Refer Adobe Primetime docs for the device info spec.
userIdStringRequiredAdobe user identifier.
profileIdStringOptionalUnique identifier of the user profile. This is applicable only for multi-profile user accounts.
    
val primeTokenResult = PlatformCoreExtensions.getAdobePrimetimeToken(
"https://<host>",
deviceId,
deviceInfo,
userId,
profileId,
platformAuthorizer
)

if (primeTokenResult is Result.Success) {
val flatToken = primeTokenResult.value.token
} else if(primeTokenResult is Result.Failure) {
val error = primeTokenResult.value
logger.warn { "Failed to acquire prime token: $error" }
}

Generic Platform API

All Quickplay Platform APIs are zero-trust protected and require OAuth token. The Platform Core client library manages the OAuth token and abstracts the ability to securely communicate with the Quickplay Platform. While many of the Platform APIs are exposed as direct APIs, some tenent specific APIs might not be available as direct API on the client library. In such cases, application could use the singleDataAuhtorizedCallWith and multiDataAuhtorizedCallWith APIs to communicate with the specific Platform API.

Create Request


val httpClient = FoundationFactory.defaultPlatformFactory().httpClientBuilder().build()

Initiate Request

Initiate an authorized request using the singleDataAuhtorizedCallWith API on the HTTPClient instance. This API allows initiating all standard HTTP requests and automatically injects the required Authentication headers to securely communicate with the Quickplay Platform.


suspend fun getLocation(): Result<FLLocation, Error> {
val response =
httpClient.singleDataAuhtorizedCallWith<Unit, FLLocation>(platformAuthorizer) {
url("https://<host>")
pathSegment("device/location/lookup")
get()
}.awaitPlatformResult()
return response.resolveServiceSingleDataResult()
}
note

Refer the Secure Playback section for creating platform authorizer instance.