Package com.iplateia.sorisdk
Class SORIApiClient
-
- All Implemented Interfaces:
public class SORIApiClient
-
-
Constructor Summary
Constructors Constructor Description SORIApiClient(String applicationId, String secretKey, String sessionId, Context context)
-
Method Summary
Modifier and Type Method Description final AuthResultauthenticate()This function performs an authentication request to the Sori API and retrieves a token, updated status, and URL from the response. final StringdownloadAudioPack(String fileUrl)This function downloads an updated audio pack from a given URL returns the local file path where the audio pack is saved. final SORICampaignpostActivity(String materialId, SORIActivityTrait trait, Boolean skipNetworkCheck)This function posts an activity to the Sori API and retrieves a campaign object from the response. final URLvisitActionUrl(URL url)-
-
Method Detail
-
authenticate
final AuthResult authenticate()
This function performs an authentication request to the Sori API and retrieves a token, updated status, and URL from the response. It authenticates the user with the Sori API using the provided application ID, secret key, and session ID.
-
downloadAudioPack
final String downloadAudioPack(String fileUrl)
This function downloads an updated audio pack from a given URL returns the local file path where the audio pack is saved.
- Parameters:
fileUrl- The URL of the audio pack to download- Returns:
The local file path where the audio pack is saved
-
postActivity
final SORICampaign postActivity(String materialId, SORIActivityTrait trait, Boolean skipNetworkCheck)
This function posts an activity to the Sori API and retrieves a campaign object from the response.
- Parameters:
materialId- The ID of the material to postskipNetworkCheck- Skip network availability check (for internal retry)- Returns:
A SORICampaign object containing campaign details, or null if the request fails
-
visitActionUrl
final URL visitActionUrl(URL url)
-
-
-
-