Customer account

Get Customer account information


Gets a customer’s account information.

Declared In

SNRClient.h

ClientAccountInformation

Class Name

Client

Method Name

getAccount(success:failure:)

Declaration

static func getAccount(success: ((ClientAccountInformation) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
success ((ClientAccountInformation) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

Client.getAccount(success: { (clientAccountInformation) in
	// success
}) { (error) in
	// failure
}

Get Customer events


Retrieves events for an authenticated customer.

Declared In

SNRClient.h

ClientEventsApiQuery

Class Name

Client

Method Name

getEvents(apiQuery:success:failure:)

Declaration

static func getEvents(apiQuery: ClientEventsApiQuery, success: (([ClientEventData]) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
apiQuery ClientEventsApiQuery yes - Object responsible for storing all query parameters
success (([ClientEventData]) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Update Customer account information


Updates a customer’s account information.

Declared In

SNRClient.h

ClientUpdateAccountContext

Class Name

Client

Method Name

updateAccount(context:success:failure:)

Declaration

static func updateAccount(context: ClientUpdateAccountContext, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
context ClientUpdateAccountContext yes - Object with client’s email, password, and other optional data
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let agreements: ClientAgreements = ClientAgreements()
agreements.email = true
agreements.sms = true
agreements.push = true
agreements.bluetooth = true
agreements.rfid = true
agreements.wifi = true
let context: ClientUpdateAccountContext = ClientUpdateAccountContext()
context.email = "hello@synerise.com"
context.phone = "123-456-789"
context.customId = "CUSTOM_ID"
context.uuid = "UUID"
context.firstName = "FIRST_NAME"
context.lastName = "LAST_NAME"
context.displayName = "DISPLAY_NAME"
context.sex = .male
context.company = "Synerise"
context.address = "Lubostroń 1"
context.city = "Kraków"
context.province = "Małopolskie"
context.zipCode = "30-383"
context.countryCode = "+48"
context.birthDate = "01-01-2019"
context.avatarUrl = "http://www.synerise.com"
context.agreements = agreements
context.attributes = ["attribute1": "value1", "attribute2": "value2"]
context.tags = ["tag1", "tag2" "tag3"]
Client.updateAccount(context: context, success: { (success) in
	// success
}) { (error) in
	// failure
}

Change Customer’s account password


Changes a customer’s password.

Declared In

SNRClient.h

Class Name

Client

Method Name

changePassword(password:oldPassword:success:failure:)

Declaration

static func changePassword(password: String, oldPassword: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
password String yes - Customer’s new password
oldPassword String yes - Customer’s old password
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let newPassword: String = "NEW_PASSWORD"
let oldPassword: String = "OLD_PASSWORD"
Client.changePassword(password: newPassword, oldPassword: oldPassword, success: { (success) in
	// success
}, failure: { (error) in
	// failure
})

Request password reset for Customer account


Requests a customer’s password reset with email. The token is sent to the provided email address.

Declared In

SNRClient.h

ClientPasswordResetRequestContext

Class Name

Client

Method Name

requestPasswordReset(context:success:failure:)

Declaration

static func requestPasswordReset(context: ClientPasswordResetRequestContext, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
context ClientPasswordResetRequestContext yes - Object with the Customer’s email
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let email: String = "EMAIL"
let context: ClientPasswordResetRequestContext = ClientPasswordResetRequestContext(email: email)
Client.requestPasswordReset(context: context, success: { (success) in
	// success
}, failure: { (error) in
	// failure
}) 

Confirm password reset for Customer account


Confirms a customer’s password reset with a new password and token.

Declared In

SNRClient.h

ClientPasswordResetConfirmationContext

Class Name

Client

Method Name

confirmResetPassword(context:success:failure:)

Declaration

static func confirmResetPassword(context: ClientPasswordResetConfirmationContext, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
context ClientPasswordResetConfirmationContext yes - Object with customer’s password and token
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let password: String = "PASSWORD"
let token: String = "TOKEN"
let context: ClientPasswordResetConfirmationContext = ClientPasswordResetConfirmationContext(password: password, token: token)
Client.confirmResetPassword(context: context, success: { (success) in
	// success
}, failure: { (error) in
	// failure
})

Request email change for Customer account


Requests a customer’s email change. A confirmation token is sent to the email address.

Declared In

SNRClient.h

Class Name

Client

Method Name

requestEmailChange(email:password:externalToken:authID:success:failure:)

Declaration

static func requestEmailChange(email: String, password: String, externalToken: AnyObject?, authID: String?, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
email String yes - Customer’s new email
password String yes - Customer’s password
externalToken AnyObject no - Client’s token (if OAuth, Facebook etc.)
authID String no - Authorization custom identity
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Confirm email change for Customer account


Confirms a customer’s email change with a token.

Declared In

SNRClient.h

Class Name

Client

Method Name

confirmEmailChange(token:success:failure:)

Declaration

static func confirmEmailChange(token: String, newsletterAgreement: Bool, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
token String yes - Client’s token provided by email
newsletterAgreement Bool yes - Agreement for newsletters to the provided email
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let token: String = "TOKEN"
Client.confirmEmailChange(token: token, success: { _ in
	// success
}) { (error) in
	// failure
}

Request phone update on Customer account


Requests a customer’s phone update. A confirmation code is sent to the phone number.

Declared In

SNRClient.h

Class Name

Client

Method Name

requestPhoneUpdate(phone:success:failure:)

Declaration

static func requestPhoneUpdate(phone: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
phone String yes - Customer’s new phone number
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let phone: String = "123-456-789"
Client.requestPhoneUpdate(phone: phone, success: { (success) in
	// success
}, failure: { (error) in
	// failure
})

Confirm phone update on Customer account


Confirms a customer’s phone update with a code.

Declared In

SNRClient.h

Class Name

Client

Method Name

confirmPhoneUpdate(phone:confirmationCode:success:failure:)

Declaration

static func confirmPhoneUpdate(phone: String, confirmationCode: String, smsAgreement: Bool, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
phone String yes - New phone number
confirmationCode String yes - Customer’s confirmation code received by phone
smsAgreement Bool yes - Agreement for SMS marketing to the provided number
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let phone: String = "123-456-789"
let confirmationCode: String = "CONFIRMATION_CODE"
Client.confirmPhoneUpdate(phone: phone, confirmationCode: confirmationCode, smsAgreement: true, success: { (success) in
	// success
}) { (error) in
	// failure
}

Delete Customer account by Identity Provider


Deletes a customer’s account information.

Declared In

SNRClient.h

Class Name

Client

Method Name

deleteAccount(clientAuthFactor:clientIdentityProvider:authID:success:failure:)

Declaration

static func deleteAccount(clientAuthFactor: String, clientIdentityProvider: ClientIdentityProvider, authID: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void))

Parameters

Parameter Type Mandatory Default Description
clientAuthFactor String yes - Customer’s token from the identity provider
clientIdentityProvider ClientIdentityProvider yes - Customer’s identity Provider
authID String no - Authorization custom identity
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Delete Customer account


Deletes a customer’s account information.

Declared In

SNRClient.h

Class Name

Client

Method Name

deleteAccount(password:success:failure:)

Declaration

static func deleteAccount(password: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void))

Parameters

Parameter Type Mandatory Default Description
password String yes - Client’s password
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let password: String = "PASSWORD"
Client.deleteAccount(password: password, success: { (success) in
	// success
}) { (error) in
	// failure
}

Delete Customer account by OAuth


Deletes a customer’s account information by OAuth.

Declared In

SNRClient.h

Class Name

Client

Method Name

deleteAccountByOAuth(accessToken:success:failure:)

Declaration

static func deleteAccountByOAuth(accessToken: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
accessToken String yes - OAuth Access Token
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Delete Customer account by Facebook


Deletes a customer’s account information by Facebook.

Declared In

SNRClient.h

Class Name

Client

Method Name

deleteAccountByFacebook(facebookToken:success:failure:)

Declaration

static func deleteAccountByFacebook(facebookToken: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
facebookToken String yes - Token from an active Facebook session
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

guard let facebookToken = FBSDKAccessToken.current()?.tokenString else {
	return
}
Client.deleteAccountByFacebookToken(facebookToken: facebookToken, success: { (success) in
	// success
}, failure: { (error) in
	// failure
})

Delete Customer account by Apple Sign In


Deletes a customer’s account information by Sign In With Apple.

Declared In

SNRClient.h

Class Name

Client

Method Name

deleteAccountByAppleSignIn(identityToken:success:failure:)

Declaration

static func deleteAccountByAppleSignIn(identityToken: Data, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters

Parameter Type Mandatory Default Description
identityToken Data yes - Token from Sign In With Apple session
success ((Bool) -> Void) yes - Closure/Block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/Block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Recognize anonymous customer


Recognize anonymous customers and save personal information from their database entries.

Declared In

SNRClient.h

Class Name

Client

Method Name

recognizeAnonymous(email:customIdentify:parameters:)

Declaration

static func recognizeAnonymousWithEmail(email: String?, customIdentify: String?, parameters: [AnyHashable: Any]?) -> Void

Parameters

Parameter Type Mandatory Default Description
email String no - Customer’s email
customIdentify String no - Customer’s custom identifier
parameters [AnyHashable: Any] no - Customer’s custom parameters

Return Value

There is no return value.

Examples

let email = "EMAIL"
let customIdentify = "CUSTOM_IDENTIFIER"
let parameters = ["key": "value"]
Client.recognizeAnonymous(email: email, customIdentify: customIdentify, parameters: parameters)
😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker