updateProfile with delete
AppDelegate.reachfive().updateProfile(authToken, ProfileUpdate)
Description
Update a user profile including removing a field.
This method allows you to remove a field from the user profile, whereas the updateProfile method only lets you update fields. |
|
Examples
import Reach5
let profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login
AppDelegate
.reachfive()
.updateProfile(
authToken: profileAuthToken,
profileUpdate: ProfileUpdate(phoneNumber: .Delete)
)
.onSuccess { updatedProfile in
// Get the updated profile
}
.onFailure { error in
// Return a ReachFive error
}
Parameters
Parameter | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Authorization token of the profile retrieved from login.
|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
The profile with the new data. Each field is a Diff.
|
Response
Type: <Profile, ReachFiveError>
Return the profile with the updated data.
If parameters are not valid or if the full_write
scope is missing, the promise will be rejected and will return a ReachFiveError
.
Profile
id |
The ReachFive identifier of the profile. |
||||||||||||||||||||||||||
givenName |
The given name of the profile. |
||||||||||||||||||||||||||
middleName |
The middle name of the profile. |
||||||||||||||||||||||||||
familyName |
The family name of the profile. |
||||||||||||||||||||||||||
name |
The full name of the profile. |
||||||||||||||||||||||||||
nickname |
The nickname of the profile. |
||||||||||||||||||||||||||
birthdate |
The birthdate of the profile, represented as an ISO 8601 |
||||||||||||||||||||||||||
profileURL |
The URL of one of the user’s profile page (usually a social provider’s page). |
||||||||||||||||||||||||||
picture |
The URL of one of the profile picture. This URL refers to an image file (PNG, JPEG, or GIF image file). |
||||||||||||||||||||||||||
externalId |
The external identifier of the profile. |
||||||||||||||||||||||||||
authTypes |
The list of the authentication providers used to login by the profile (e.g. facebook, password …). |
||||||||||||||||||||||||||
loginSummary |
The login activities history of the profile.
|
||||||||||||||||||||||||||
username |
The username of the profile (the login’s name). |
||||||||||||||||||||||||||
gender |
The gender of the profile. Allowed values are |
||||||||||||||||||||||||||
email |
The primary email address of the profile. |
||||||||||||||||||||||||||
emailVerified |
|
||||||||||||||||||||||||||
emails |
The e-mail addresses of the profile.
|
||||||||||||||||||||||||||
phoneNumber |
The primary phone number of the profile. Both the international format and the national conventions of the account’s country are accepted if configured in account settings. |
||||||||||||||||||||||||||
phoneNumberVerified |
|
||||||||||||||||||||||||||
addresses |
The list of the profile’s postal addresses. To get this attribute, the profile must have been granted the
|
||||||||||||||||||||||||||
locale |
The profile’s language code in lowercase and country code in uppercase, separated by a dash (e.g. |
||||||||||||||||||||||||||
bio |
The biography of the profile. |
||||||||||||||||||||||||||
customFields |
The custom fields of the profile. |
||||||||||||||||||||||||||
consents |
The consents granted to the profile. It is a map of string keys with the associated consent object.
|
||||||||||||||||||||||||||
createdAt |
The time the profile’s information was created. |
||||||||||||||||||||||||||
updatedAt |
The time the profile’s information was last updated. |
ReachFiveError
Based on the problem, the ReachFiveError
will be:
-
AuthCanceled
: The user cancelled the request or no credential was available in the keychain. -
RequestError(apiError: ApiError)
for a Bad Request (status 400) error. -
AuthFailure(reason: String, apiError: ApiError?)
mainly for Unauthorized (status 401) error. -
TechnicalError(reason: String, apiError: ApiError?)
if it’s an Internal Server Error (status 500) or other internal errors.
ApiError
error |
The main error message. |
||||||
errorId |
The identifier of the error. |
||||||
errorUserMsg |
The user-friendly error message.
|
||||||
errorMessageKey |
The error message key. |
||||||
errorDescription |
The technical error message. |
||||||
errorDetails FieldError[] |
|