Elements Manual
Elements 3 Manual
Elements 3 Manual
  • Welcome 👋
  • QUICK START
    • Elements in Five Minutes or Less
    • Accessing the Web UI (CRM)
    • Creating A User
  • General
    • General Concepts
    • N-Tier Architecture
    • Security Model
  • Core Features
    • Core API Overview
    • Sessions
    • Applications
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Leaderboards
    • Matchmaking
    • Followers
    • Friends
    • Reward Issuance
    • Save Data
    • Schemas and Metadata Specifications
    • Queries
      • Base Query Syntax
      • Boolean Queries
      • Object Graph Navigation
      • Advanced Operators
        • .ref
        • .name
    • Custom Code
      • Element Structure
      • RESTful APIs
      • Websockets
    • Auth Schemes
      • OIDC
      • OAuth2
  • Web 3
    • Omni Chain Support
    • Vaults
    • Wallets
    • Smart Contracts
      • Smart Contracts: Ethereum
      • Smart Contracts: Flow
      • Smart Contracts: Solana
      • Smart Contracts: Neo
  • CONFIGURATION
    • Direct Database Access and Batch Configuration
    • Batch Samples
      • Item Upload Bash Script Sample
      • Mission Upload Bash Script Sample
  • RESTful APIs
    • Swagger and Swagger UI
    • API Specification
      • /application
      • /application/configuration
      • /auth
      • /auth_scheme
        • /custom
        • /oauth2
        • /oidc
      • /blockchain
      • /followee
      • /follower
      • /friend
      • /google
      • /index
      • /inventory
      • /item
      • /large_object
      • /leaderboard
      • /rank
      • /score
      • /match
      • /mission
      • /progress
      • /reward_issuance
      • /schedule
      • /notification
      • /profile
      • /save_data
      • /metadata_spec
      • /mock_session
      • /session
      • /health
      • /version
      • /signup
      • /user
    • Javadocs
  • Releases
    • 3.1 Release Notes
Powered by GitBook
On this page
  1. RESTful APIs
  2. Elements 3.0.X (Preview)

User and Profiles

Gets a Specific User

get

Gets a specific user by email or unique user ID.

Authorizations
Path parameters
nameanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/user/{name} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Deletes a User

delete

Deletes and permanently removes the user from the server. The server may keep some metadata as necessary to avoid data inconsistency. However, the user has been deleted from the client standpoint and will not be accessible through any of the existing APIs.

Authorizations
Path parameters
nameanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
*/*
delete
DELETE /api/rest/user/{name} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Gets the current User

get

A special endpoint used to get the current user for the request. The current user is typically associated with the session but may be derived any other way. This is essentially an alias for using GET /user/myUserId

Authorizations
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/user/me HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Search Users

get

Searches all users in the system and returning the metadata for all matches against the given search filter.

Authorizations
Query parameters
offsetanyOptionalDefault: 0
countanyOptionalDefault: 20
searchanyOptional
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
get
GET /api/rest/user HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Destroys the Session

delete
Authorizations
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
*/*
delete
DELETE /api/rest/session HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Destroys the Session

delete
Authorizations
Path parameters
sessionSecretanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
*/*
delete
DELETE /api/rest/session/{sessionSecret} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}
  • GETGets a Specific User
  • DELETEDeletes a User
  • PUTUpdates a User's Password
  • PUTUpdates a User
  • GETGets the current User
  • POSTCreates a User
  • GETSearch Users
  • POSTSign Up a User
  • DELETEDestroys the Session
  • POSTCreates a Session
  • DELETEDestroys the Session
  • POSTCreates a Session using Google Sign-In
  • POSTCreates a Session using Firebase
  • POSTCreates a Session using Facebook
  • POSTCreates a Session using Apple Sign-In

Updates a User's Password

put

Supplying the UserUpdatePasswordRequest, this will attempt to update the user's password only if they supply the correct existing password.

Authorizations
Path parameters
userIdanyRequired
Body
oldPasswordanyRequired

The user's current password.

newPasswordanyRequired

The user's updated password.

profileIdanyOptional

The user's profile id to assign the new session. Leave blank for no profile id.

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
put
PUT /api/rest/user/{userId}/password HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 56

{
  "oldPassword": null,
  "newPassword": null,
  "profileId": null
}
{
  "code": "text",
  "message": "text"
}

Updates a User

put

Supplying the user object, this will update the user with the new information supplied in the body of the request. Optionally, the user's password may be provided in the User object.

Authorizations
Path parameters
userIdanyRequired
Body
nameanyRequiredPattern: ^\S+$
emailanyRequiredPattern: ^(.+)@(.+)$
primaryPhoneNbanyOptionalPattern: ([\.\+\-\s\/()]*[0-9][\.\+\-\s\/()]*){8,15}
firstNameanyOptionalPattern: ^[A-Za-z0-9 ]{2,20}
lastNameanyOptionalPattern: ^[A-Za-z0-9 ]{3,30}
passwordanyOptional

The user's plaintext password, only to be provided in POST/PUT requests in the User Resource REST API interface. In the future, a dedicated REST API model may be constructed instead of using a direct User model.

Pattern: ^\S+$
levelundefined · enumRequiredPossible values:
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
put
PUT /api/rest/user/{userId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 120

{
  "name": null,
  "email": null,
  "primaryPhoneNb": null,
  "firstName": null,
  "lastName": null,
  "password": null,
  "level": "UNPRIVILEGED"
}
{
  "code": "text",
  "message": "text"
}

Creates a User

post

Supplying the user object, this will update the user with the new information supplied in the body of the request. Optionally, the user's password may be provided in the User object.

Authorizations
Body
nameanyOptionalPattern: ^\S+$
emailanyOptionalPattern: ^(.+)@(.+)$
primaryPhoneNbanyOptionalPattern: ([\.\+\-\s\/()]*[0-9][\.\+\-\s\/()]*){8,15}
firstNameanyOptionalPattern: ^[A-Za-z0-9 ]{2,20}
lastNameanyOptionalPattern: ^[A-Za-z0-9 ]{3,30}
passwordanyOptional

The user's plaintext password, only to be provided in POST/PUT requests in the User Resource REST API interface. In the future, a dedicated REST API model may be constructed instead of using a direct User model.

Pattern: ^\S+$
levelundefined · enumOptional

The user's level to assign. Depending on the usage, the server may ignore this field and assign its own description.

Possible values:
profilesanyOptional

A list of profiles to assign to this user during creation. The server will attempt to create a profile for each item in this list.

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/user HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 191

{
  "name": null,
  "email": null,
  "primaryPhoneNb": null,
  "firstName": null,
  "lastName": null,
  "password": null,
  "level": "UNPRIVILEGED",
  "profiles": [
    {
      "applicationId": null,
      "displayName": null,
      "imageUrl": null
    }
  ]
}
{
  "code": "text",
  "message": "text"
}

Sign Up a User

post

Supplying the user create request object, this will create a new user.

Authorizations
Body
nameanyOptionalPattern: ^\S+$
emailanyOptionalPattern: ^(.+)@(.+)$
primaryPhoneNbanyOptionalPattern: ([\.\+\-\s\/()]*[0-9][\.\+\-\s\/()]*){8,15}
firstNameanyOptionalPattern: ^[A-Za-z0-9 ]{2,20}
lastNameanyOptionalPattern: ^[A-Za-z0-9 ]{3,30}
passwordanyOptional

The user's plaintext password, only to be provided in POST/PUT requests in the User Resource REST API interface. In the future, a dedicated REST API model may be constructed instead of using a direct User model.

Pattern: ^\S+$
levelundefined · enumOptional

The user's level to assign. Depending on the usage, the server may ignore this field and assign its own description.

Possible values:
profilesanyOptional

A list of profiles to assign to this user during creation. The server will attempt to create a profile for each item in this list.

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/signup HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 191

{
  "name": null,
  "email": null,
  "primaryPhoneNb": null,
  "firstName": null,
  "lastName": null,
  "password": null,
  "level": "UNPRIVILEGED",
  "profiles": [
    {
      "applicationId": null,
      "displayName": null,
      "imageUrl": null
    }
  ]
}
{
  "code": "text",
  "message": "text"
}

Creates a Session

post

Begins a session by accepting both the UserID and the Passoword. Upon successful completion of this call, the user will be added to the current HTTP session. If the session expires, the user will have to reestablish the session by supplying credentials again. This is most useful for applications delivered in a web page.

Authorizations
Body
userIdanyRequired

The user ID.

passwordanyRequired

The password.

profileIdanyOptional

The profile ID to assign to the session.

profileSelectoranyOptional

A query string to select the profile to use.

Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/session HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 71

{
  "userId": null,
  "password": null,
  "profileId": null,
  "profileSelector": null
}
{
  "code": "text",
  "message": "text"
}

Creates a Session using Google Sign-In

post

Begins a session by accepting an auth code and identity token. Upon successful validation against Google's sign-in APIs, this will return a Session which can be used for authentication. If there isno User associated with the supplied credentials, this will implicitly create a new account and will include that account information in the response. If there is an account, or this method receives an existing session key, this will link the existing account to google if the account was not previously linked.

Authorizations
Body
applicationNameOrIdanyRequired
identityTokenanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/googlesignin_session HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 49

{
  "applicationNameOrId": null,
  "identityToken": null
}
{
  "code": "text",
  "message": "text"
}

Creates a Session using Firebase

post

Begins a session using Firebase login. Unlike other auth methods, which require the client specify the profile and name, this uses the supplied JWT token. Embedded in the JWT is the identifier for the application. Therefore, Elements will use Firebase's server-to-server APIs in order determine the application configuration to use. Just like other session APIs, if the session specifies a user, then this will link the existing account to the supplied firebase ID.

Authorizations
Body
firebaseJWTanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/firebase_session HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "firebaseJWT": null
}
{
  "code": "text",
  "message": "text"
}

Creates a Session using Facebook

post

Begins a session by accepting a Facebook OAuth token, SocialEngine Application ID, and the configuration ID for the application. This will generate a Session instance and return the result to the client.

Authorizations
Body
applicationNameOrIdanyRequired
applicationConfigurationNameOrIdanyRequired
facebookOAuthAccessTokenanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/facebook_session HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 100

{
  "applicationNameOrId": null,
  "applicationConfigurationNameOrId": null,
  "facebookOAuthAccessToken": null
}
{
  "code": "text",
  "message": "text"
}

Creates a Session using Apple Sign-In

post

Begins a session by accepting an auth code and identity token. Upon successful validation against Apple's sign-in APIs, this will return a Session which can be used for authentication. If there isno User associated with the supplied credentials, this will implicitly create a new account and will include that account information in the response. If there is an account, or this method receives an existing session key, this will link the existing account to apple if the account was not previously linked.

Authorizations
Body
applicationNameOrIdanyRequired
identityTokenanyRequired
Responses
400Error
application/json
401Error
application/json
403Error
application/json
404Error
application/json
409Error
application/json
500Error
application/json
501Error
application/json
503Error
application/json
default
default response
application/json
post
POST /api/rest/applesignin_session HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 49

{
  "applicationNameOrId": null,
  "identityToken": null
}
{
  "code": "text",
  "message": "text"
}