Thrift module: UserStore

ModuleServicesData typesConstants
UserStoreUserStore
AuthenticationResult
BootstrapInfo
BootstrapProfile
BootstrapSettings
PublicUserInfo
UserUrls
EDAM_VERSION_MAJOR
EDAM_VERSION_MINOR

Constants

ConstantTypeValue
EDAM_VERSION_MAJORi161
The major version number for the current revision of the EDAM protocol. Clients pass this to the service using UserStore.checkVersion at the beginning of a session to confirm that they are not out of date.
EDAM_VERSION_MINORi1628
The minor version number for the current revision of the EDAM protocol. Clients pass this to the service using UserStore.checkVersion at the beginning of a session to confirm that they are not out of date.

Data structures

Struct: PublicUserInfo

FieldType
userIdTypes.UserID
serviceLevelTypes.ServiceLevel
usernamestring
noteStoreUrlstring
webApiUrlPrefixstring

This structure is used to provide publicly-available user information about a particular account.
userId:
The unique numeric user identifier for the user account.
shardId:
DEPRECATED - Client applications should have no need to use this field.
privilege:
DEPRECATED - ServiceLevel field should be used instead to determine which features to offer to the user.
serviceLevel:
The service level of the account.
noteStoreUrl:
This field will contain the full URL that clients should use to make NoteStore requests to the server shard that contains that user's data. I.e. this is the URL that should be used to create the Thrift HTTP client transport to send messages to the NoteStore service for the account.
webApiUrlPrefix:
This field will contain the initial part of the URLs that should be used to make requests to Evernote's thin client "web API", which provide optimized operations for clients that aren't capable of manipulating the full contents of accounts via the full Thrift data model. Clients should concatenate the relative path for the various servlets onto the end of this string to construct the full URL, as documented on our developer web site.

Struct: UserUrls

FieldType
noteStoreUrlstring
webApiUrlPrefixstring
userStoreUrlstring
utilityUrlstring
messageStoreUrlstring
userWebSocketUrlstring

noteStoreUrl:
This field will contain the full URL that clients should use to make NoteStore requests to the server shard that contains that user's data. I.e. this is the URL that should be used to create the Thrift HTTP client transport to send messages to the NoteStore service for the account.
webApiUrlPrefix:
This field will contain the initial part of the URLs that should be used to make requests to Evernote's thin client "web API", which provide optimized operations for clients that aren't capable of manipulating the full contents of accounts via the full Thrift data model. Clients should concatenate the relative path for the various servlets onto the end of this string to construct the full URL, as documented on our developer web site.
userStoreUrl:
This field will contain the full URL that clients should use to make UserStore requests after successfully authenticating. I.e. this is the URL that should be used to create the Thrift HTTP client transport to send messages to the UserStore service for this account.
utilityUrl:
This field will contain the full URL that clients should use to make Utility requests to the server shard that contains that user's data. I.e. this is the URL that should be used to create the Thrift HTTP client transport to send messages to the Utility service for the account.
messageStoreUrl:
This field will contain the full URL that clients should use to make MessageStore requests to the server. I.e. this is the URL that should be used to create the Thrift HTTP client transport to send messages to the MessageStore service for the account.
userWebSocketUrl:
This field will contain the full URL that clients should use when opening a persistent web socket to recieve notification of events for the authenticated user.

Struct: AuthenticationResult

FieldType
currentTimeTypes.Timestamp
authenticationTokenstring
expirationTypes.Timestamp
userTypes.User
publicUserInfoPublicUserInfo
noteStoreUrlstring
webApiUrlPrefixstring
secondFactorRequiredbool
secondFactorDeliveryHintstring
urlsUserUrls

When an authentication (or re-authentication) is performed, this structure provides the result to the client.
currentTime:
The server-side date and time when this result was generated.
authenticationToken:
Holds an opaque, ASCII-encoded token that can be used by the client to perform actions on a NoteStore.
expiration:
Holds the server-side date and time when the authentication token will expire. This time can be compared to "currentTime" to produce an expiration time that can be reconciled with the client's local clock.
user:
Holds the information about the account which was authenticated if this was a full authentication. May be absent if this particular authentication did not require user information.
publicUserInfo:
If this authentication result was achieved without full permissions to access the full User structure, this field may be set to give back a more limited public set of data.
noteStoreUrl:
DEPRECATED - Client applications should use urls.noteStoreUrl.
webApiUrlPrefix:
DEPRECATED - Client applications should use urls.webApiUrlPrefix.
secondFactorRequired:
If set to true, this field indicates that the user has enabled two-factor authentication and must enter their second factor in order to complete authentication. In this case the value of authenticationResult will be a short-lived authentication token that may only be used to make a subsequent call to completeTwoFactorAuthentication.
secondFactorDeliveryHint:
When secondFactorRequired is set to true, this field may contain a string describing the second factor delivery method that the user has configured. This will typically be an obfuscated mobile device number, such as "(xxx) xxx-x095". This string can be displayed to the user to remind them how to obtain the required second factor.
urls
This structure will contain all of the URLs that clients need to make requests to the Evernote service on behalf of the authenticated User.

Struct: BootstrapSettings

FieldType
serviceHoststring
marketingUrlstring
supportUrlstring
accountEmailDomainstring
enableFacebookSharingbool
enableGiftSubscriptionsbool
enableSupportTicketsbool
enableSharedNotebooksbool
enableSingleNoteSharingbool
enableSponsoredAccountsbool
enableTwitterSharingbool
enableLinkedInSharingbool
enablePublicNotebooksbool
enableGooglebool

This structure describes a collection of bootstrap settings.
serviceHost:
The hostname and optional port for composing Evernote web service URLs. This URL can be used to access the UserStore and related services, but must not be used to compose the NoteStore URL. Client applications must handle serviceHost values that include only the hostname (e.g. www.evernote.com) or both the hostname and port (e.g. www.evernote.com:8080). If no port is specified, or if port 443 is specified, client applications must use the scheme "https" when composing URLs. Otherwise, a client must use the scheme "http".
marketingUrl:
The URL stem for the Evernote corporate marketing website, e.g. http://www.evernote.com. This stem can be used to compose website URLs. For example, the URL of the Evernote Trunk is composed by appending "/about/trunk/" to the value of marketingUrl.
supportUrl:
The full URL for the Evernote customer support website, e.g. https://support.evernote.com.
accountEmailDomain:
The domain used for an Evernote user's incoming email address, which allows notes to be emailed into an account. E.g. m.evernote.com.
enableFacebookSharing:
Whether the client application should enable sharing of notes on Facebook.
enableGiftSubscriptions:
Whether the client application should enable gift subscriptions.
enableSupportTickets:
Whether the client application should enable in-client creation of support tickets.
enableSharedNotebooks:
Whether the client application should enable shared notebooks.
enableSingleNoteSharing:
Whether the client application should enable single note sharing.
enableSponsoredAccounts:
Whether the client application should enable sponsored accounts.
enableTwitterSharing:
Whether the client application should enable sharing of notes on Twitter.
enableGoogle:
Whether the client application should enable authentication with Google, for example to allow integration with a user's Gmail contacts.

Struct: BootstrapProfile

FieldType
namestring
settingsBootstrapSettings

This structure describes a collection of bootstrap settings.
name:
The unique name of the profile, which is guaranteed to remain consistent across calls to getBootstrapInfo.
settings:
The settings for this profile.

Struct: BootstrapInfo

FieldType
profileslist<BootstrapProfile>

This structure describes a collection of bootstrap profiles.
profiles:
List of one or more bootstrap profiles, in descending preference order.


Services

Service: UserStore

Service: UserStore

The UserStore service is primarily used by EDAM clients to establish authentication via username and password over a trusted connection (e.g. SSL). A client's first call to this interface should be checkVersion() to ensure that the client's software is up to date.

All calls which require an authenticationToken may throw an EDAMUserException for the following reasons:

Function: UserStore.checkVersion

bool checkVersion(string clientName,
                  i16 edamVersionMajor = 1,
                  i16 edamVersionMinor = 28)
This should be the first call made by a client to the EDAM service. It tells the service what protocol version is used by the client. The service will then return true if the client is capable of talking to the service, and false if the client's protocol version is incompatible with the service, so the client must upgrade. If a client receives a false value, it should report the incompatibility to the user and not continue with any more EDAM requests (UserStore or NoteStore).

@param  clientName This string provides some information about the client for tracking/logging on the service. It should provide information about the client's software and platform. The structure should be: application/version; platform/version; [ device/version ] E.g. "Evernote Windows/3.0.1; Windows/XP SP3".

@param  edamVersionMajor This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MAJOR constant for the client.

@param  edamVersionMinor This should be the major protocol version that was compiled by the client. This should be the current value of the EDAM_VERSION_MINOR constant for the client.

Function: UserStore.getBootstrapInfo

BootstrapInfo getBootstrapInfo(string locale)
This provides bootstrap information to the client. Various bootstrap profiles and settings may be used by the client to configure itself.

@param  locale The client's current locale, expressed in language[_country] format. E.g., "en_US". See ISO-639 and ISO-3166 for valid language and country codes.

@return The bootstrap information suitable for this client.

Function: UserStore.authenticateLongSession

AuthenticationResult authenticateLongSession(string username,
                                             string password,
                                             string consumerKey,
                                             string consumerSecret,
                                             string deviceIdentifier,
                                             string deviceDescription,
                                             bool supportsTwoFactor)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
This is used to check a username and password in order to create a long-lived authentication token that can be used for further actions.

This function is not available to most third party applications, which typically authenticate using OAuth as described at dev.evernote.com. If you believe that your application requires permission to authenticate using username and password instead of OAuth, please contact Evernote developer support by visiting dev.evernote.com.

@param  username The username or registered email address of the account to authenticate against.

@param  password The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (i.e. SSL).

@param  consumerKey The "consumer key" portion of the API key issued to the client application by Evernote.

@param  consumerSecret The "consumer secret" portion of the API key issued to the client application by Evernote.

@param  deviceIdentifier An optional string that uniquely identifies the device from which the authentication is being performed. This string allows the service to return the same authentication token when a given application requests authentication repeatedly from the same device. This may happen when the user logs out of an application and then logs back in, or when the application is uninstalled and later reinstalled. If no reliable device identifier can be created, this value should be omitted. If set, the device identifier must be between 1 and EDAM_DEVICE_ID_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_ID_REGEX.

@param  deviceDescription A description of the device from which the authentication is being performed. This field is displayed to the user in a list of authorized applications to allow them to distinguish between multiple tokens issued to the same client application on different devices. For example, the Evernote iOS client on a user's iPhone and iPad might pass the iOS device names "Bob's iPhone" and "Bob's iPad". The device description must be between 1 and EDAM_DEVICE_DESCRIPTION_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_DESCRIPTION_REGEX.

@param  supportsTwoFactor Whether the calling application supports two-factor authentication. If this parameter is false, this method will fail with the error code INVALID_AUTH and the parameter "password" when called for a user who has enabled two-factor authentication.

@return

The result of the authentication. The level of detail provided in the returned AuthenticationResult.User structure depends on the access level granted by calling application's API key.

If the user has two-factor authentication enabled, AuthenticationResult.secondFactorRequired will be set and AuthenticationResult.authenticationToken will contain a short-lived token that may only be used to complete the two-factor authentication process by calling UserStore.completeTwoFactorAuthentication.

@throws  EDAMUserException


Function: UserStore.completeTwoFactorAuthentication

AuthenticationResult completeTwoFactorAuthentication(string authenticationToken,
                                                     string oneTimeCode,
                                                     string deviceIdentifier,
                                                     string deviceDescription)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
Complete the authentication process when a second factor is required. This call is made after a successful call to authenticate or authenticateLongSession when the authenticating user has enabled two-factor authentication.

@param  authenticationToken An authentication token returned by a previous call to UserStore.authenticate or UserStore.authenticateLongSession that could not be completed in a single call because a second factor was required.

@param  oneTimeCode The one time code entered by the user. This value is delivered out-of-band, typically via SMS or an authenticator application.

@param  deviceIdentifier See the corresponding parameter in authenticateLongSession.

@param  deviceDescription See the corresponding parameter in authenticateLongSession.

@return The result of the authentication. The level of detail provided in the returned AuthenticationResult.User structure depends on the access level granted by the calling application's API key. If the initial authentication call was made to authenticateLongSession, the AuthenticationResult will contain a long-lived authentication token.

@throws  EDAMUserException


Function: UserStore.revokeLongSession

void revokeLongSession(string authenticationToken)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
Revoke an existing long lived authentication token. This can be used to revoke OAuth tokens or tokens created by calling authenticateLongSession, and allows a user to effectively log out of Evernote from the perspective of the application that holds the token. The authentication token that is passed is immediately revoked and may not be used to call any authenticated EDAM function.

@param  authenticationToken the authentication token to revoke.

@throws  EDAMUserException


Function: UserStore.authenticateToBusiness

AuthenticationResult authenticateToBusiness(string authenticationToken)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
This is used to take an existing authentication token that grants access to an individual user account (returned from 'authenticate', 'authenticateLongSession' or an OAuth authorization) and obtain an additional authentication token that may be used to access business notebooks if the user is a member of an Evernote Business account.

The resulting authentication token may be used to make NoteStore API calls against the business using the NoteStore URL returned in the result.

@param  authenticationToken The authentication token for the user. This may not be a shared authentication token (returned by NoteStore.authenticateToSharedNotebook or NoteStore.authenticateToSharedNote) or a business authentication token.

@return The result of the authentication, with the token granting access to the business in the result's 'authenticationToken' field. The URL that must be used to access the business account NoteStore will be returned in the result's 'noteStoreUrl' field. The 'User' field will not be set in the result.

@throws  EDAMUserException


Function: UserStore.getUser

Types.User getUser(string authenticationToken)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
Returns the User corresponding to the provided authentication token, or throws an exception if this token is not valid. The level of detail provided in the returned User structure depends on the access level granted by the token, so a web service client may receive fewer fields than an integrated desktop client.

Function: UserStore.getPublicUserInfo

PublicUserInfo getPublicUserInfo(string username)
    throws Errors.EDAMNotFoundException, Errors.EDAMSystemException, Errors.EDAMUserException
Asks the UserStore about the publicly available location information for a particular username.

@throws  EDAMUserException


Function: UserStore.getPremiumInfo

Types.PremiumInfo getPremiumInfo(string authenticationToken)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
Returns information regarding a user's Premium account corresponding to the provided authentication token, or throws an exception if this token is not valid.

NOTE: This function is generally not available to third party applications. Calls will result in an EDAMUserException with the error code PERMISSION_DENIED.

Function: UserStore.getUserUrls

UserUrls getUserUrls(string authenticationToken)
    throws Errors.EDAMUserException, Errors.EDAMSystemException

Returns the URLs that should be used when sending requests to the service on behalf of the account represented by the provided authenticationToken.

This method isn't needed by most clients, who can retreive the correct set of UserUrls from the AuthenticationResult returned from UserStore#authenticateLongSession(). This method is typically only needed to look up the correct URLs for an existing long-lived authentication token.


Function: UserStore.inviteToBusiness

void inviteToBusiness(string authenticationToken,
                      string emailAddress)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
Invite a user to join an Evernote Business account.

Behavior will depend on the auth token.

  1. auth token with privileges to manage Evernote Business membership. "External Provisioning" - The user will receive an email inviting them to join the business. They do not need to have an existing Evernote account. If the user has already been invited, a new invitation email will be sent.
  2. business auth token issued to an admin user. Only for first-party clients: "Approve Invitation" - If there has been a request to invite the email, approve it. Invited user will receive email with a link to join business. "Invite User" - If no invitation for the email exists, create an approved invitation for the email. An email will be sent to the emailAddress with a link to join the caller's business.
  3. business auth token: "Request Invitation" - If no invitation exists, create a request to invite the user to the business. These requests do not count towards a business' max active user limit.

@param  authenticationToken the authentication token with sufficient privileges to manage Evernote Business membership or a business auth token.

@param  emailAddress the email address of the user to invite to join the Evernote Business account.

@throws  EDAMUserException


Function: UserStore.removeFromBusiness

void removeFromBusiness(string authenticationToken,
                        string emailAddress)
    throws Errors.EDAMUserException, Errors.EDAMSystemException, Errors.EDAMNotFoundException
Remove a user from an Evernote Business account. Once removed, the user will no longer be able to access content within the Evernote Business account.

The email address of the user to remove from the business must match the email address used to invite a user to join the business via UserStore.inviteToBusiness. This function will only remove users who were invited by external provisioning

@param  authenticationToken An authentication token with sufficient privileges to manage Evernote Business membership.

@param  emailAddress The email address of the user to remove from the Evernote Business account.

@throws  EDAMUserException

@throws  EDAMNotFoundException

Function: UserStore.updateBusinessUserIdentifier

void updateBusinessUserIdentifier(string authenticationToken,
                                  string oldEmailAddress,
                                  string newEmailAddress)
    throws Errors.EDAMUserException, Errors.EDAMSystemException, Errors.EDAMNotFoundException
Update the email address used to uniquely identify an Evernote Business user.

This will update the identifier for a user who was previously invited using inviteToBusiness, ensuring that caller and the Evernote service maintain an agreed-upon identifier for a specific user.

For example, the following sequence of calls would invite a user to join a business, update their email address, and then remove the user from the business using the updated email address.

inviteToBusiness("foo@bar.com") updateBusinessUserIdentifier("foo@bar.com", "baz@bar.com") removeFromBusiness("baz@bar.com")

@param  authenticationToken An authentication token with sufficient privileges to manage Evernote Business membership.

@param  oldEmailAddress The existing email address used to uniquely identify the user.

@param  newEmailAddress The new email address used to uniquely identify the user.

@throws  EDAMUserException

@throws  EDAMNotFoundException

Function: UserStore.listBusinessUsers

list<Types.UserProfile> listBusinessUsers(string authenticationToken)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
Returns a list of active business users in a given business.

Clients are required to cache this information and re-fetch no more than once per day or when they encountered a user ID or username that was not known to them.

To avoid excessive look ups, clients should also track user IDs and usernames that belong to users who are not in the business, since they will not be included in the result.

I.e., when a client encounters a previously unknown user ID as a note's creator, it may query listBusinessUsers to find information about this user. If the user is not in the resulting list, the client should track that fact and not re-query the service the next time that it sees this user on a note.

@param  authenticationToken A business authentication token returned by authenticateToBusiness or with sufficient privileges to manage Evernote Business membership.

Function: UserStore.listBusinessInvitations

list<Types.BusinessInvitation> listBusinessInvitations(string authenticationToken,
                                                       bool includeRequestedInvitations)
    throws Errors.EDAMUserException, Errors.EDAMSystemException
Returns a list of outstanding invitations to join an Evernote Business account.

Only outstanding invitations are returned by this function. Users who have accepted an invitation and joined a business are listed using listBusinessUsers.

@param  authenticationToken An authentication token with sufficient privileges to manage Evernote Business membership.

@param  includeRequestedInvitations If true, invitations with a status of BusinessInvitationStatus.REQUESTED will be included in the returned list. If false, only invitations with a status of BusinessInvitationStatus.APPROVED will be included.

Function: UserStore.getAccountLimits

Types.AccountLimits getAccountLimits(Types.ServiceLevel serviceLevel)
    throws Errors.EDAMUserException
Retrieve the standard account limits for a given service level. This should only be called when necessary, e.g. to determine if a higher level is available should the user upgrade, and should be cached for long periods (e.g. 30 days) as the values are not expected to fluctuate frequently.

@throws  EDAMUserException