ZTApi

object ZTApi

This object provides an API for application user

Author

Alexandre Lemoult <a.lemoult@zhortech.com>

Functions

addActivityComment
Link copied to clipboard
fun addActivityComment(activityId: String, text: String, mediaFileTemplates: Array<ZTMediaFileTemplate>?): Observable<ZTActivityComment>
Add new comment for activity
addMediaFileToComment
Link copied to clipboard
fun addMediaFileToComment(commentId: String, mediaFileTemplate: ZTMediaFileTemplate): Observable<ZTMediaFile>
Link uploaded media files with comment
createRestService
Link copied to clipboard
fun <T> createRestService(clazz: Class<*>): T
deleteActivity
Link copied to clipboard
fun deleteActivity(activityId: String): Completable
deleteComment
Link copied to clipboard
fun deleteComment(commentId: String): Completable
Delete uploaded comment
deleteMediaFileFromComment
Link copied to clipboard
fun deleteMediaFileFromComment(mediaFileId: String): Completable
Delete media file linked to comment
deleteUser
Link copied to clipboard
fun deleteUser(): Completable
Delete current user from zt cloud
editActivityComment
Link copied to clipboard
fun editActivityComment(commentId: String, newText: String): Observable<ZTActivityComment>
Update message of uploaded comment entity
getActivityComment
Link copied to clipboard
fun getActivityComment(commentId: String): Observable<ZTActivityComment>
Get uploaded comment entity
getActivityComments
Link copied to clipboard
fun getActivityComments(activityId: String): Observable<Array<ZTActivityComment>>
Get finished activity comments
getAppAttributes
Link copied to clipboard
fun getAppAttributes(): Observable<Map<String, Any>>
Fetch app's attributes defined on ZCloud.
getUnsafeOkHttpClient
Link copied to clipboard
fun getUnsafeOkHttpClient(): OkHttpClient?
getUserAchievements
Link copied to clipboard
fun getUserAchievements(): Observable<Array<ZTAchievement>>
getUserProfileImage
Link copied to clipboard
fun getUserProfileImage(): Single<Bitmap?>
isOrgCodeExist
Link copied to clipboard
fun isOrgCodeExist(orgCode: String): Single<ApiResponseModel.OrgCodeExistResponse>
isUserExist
Link copied to clipboard
fun isUserExist(attributeName: String, attributeValue: String): Single<Boolean>
Check if there are any matches for given attribute
linkUser
Link copied to clipboard
fun linkUser(userId: String, payload: Map<String, Any>): Completable
Associate an application user with unique ID and record traits about it.
log
Link copied to clipboard
fun log(logPayload: LogPayload): Completable
logCustomEvent
Link copied to clipboard
fun logCustomEvent(eventName: String, data: Any? = null, attributes: Any? = null)
startActivity
Link copied to clipboard
fun startActivity(activity: ZTActivity): Observable<String>
testRetry
Link copied to clipboard
fun testRetry(ms: Long, attempts: Int, code: Int): Observable<ResponseBody>
updateActivityAttributes
Link copied to clipboard
fun updateActivityAttributes(activityId: String, attributes: Map<String, Any>): Completable
updatePushNotificationToken
Link copied to clipboard
fun updatePushNotificationToken(token: String): Completable
updateUserAttributes
Link copied to clipboard
fun updateUserAttributes(userId: String, payload: Map<String, Any>): Completable
Update user attributes
updateUserId
Link copied to clipboard
fun updateUserId(userId: String): Completable
updateUserProfileImage
Link copied to clipboard
fun updateUserProfileImage(base64String: String): Completable
uploadMediaFile
Link copied to clipboard
fun uploadMediaFile(templatePayload: ZTMediaFileTemplatePayload, context: Context? = null): Observable<ZTMediaFileTemplate>
Upload media file to zt cloud storage.