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. API Specification

/match

Previous/scoreNext/mission

Last updated 2 months ago

Gets a Specific Match

get

Gets a specific match given the match's unique ID. Additionally, it is possible to instruct the API to wait for a period of time before sending the response. The request will intentionally hang until the requested Match with ID has been updated in the database.

Authorizations
Path parameters
matchIdanyRequired
Header parameters
SocialEngine-LongPoll-TimeoutanyOptional

The maximum amount time the server will wait until a request returns a default set of data for long polling. Specifying a zero will request that the server wait indefinitely until responding. Though, the server may enforce a practical upper limit on the amount of time it takes to return. Omitting this header will prompt the server to treat the request as a normal request.

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
application/json
get
GET /api/rest/match/{matchId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Deletes a Match

delete

Deletes and permanently removes the Match fromt he server. This effectively will cancel any pending request for a match. If a game is currently being played agaist the match, the server may reject the request to delete the match until the game concludes.

Authorizations
Path parameters
matchIdanyRequired
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
delete
DELETE /api/rest/match/{matchId} HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}
  • GETList Matches
  • POSTCreates a Match
  • GETGets a Specific Match
  • DELETEDeletes a Match

List Matches

get

Lists all matches available. Under most circumstances, this will requires that a profile be made available to the request. The server may choose to return an error if no suitable profile can be determined.

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/match HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Accept: */*
{
  "code": "text",
  "message": "text"
}

Creates a Match

post

This method accepts an instance of Match, effectively requesting that the server find a suitable opponent for a game. As other suitable players create matches the created match object may be updated as a suitable opponent is found. The client must poll matches for updates and react accordingly.

Authorizations
Body

Represents a single one-on-one match between the current player and an opponent. Once matched, the player will will be able to create a game against the supplied opposing player. The server may modify or delete matches based on a variety of circumstances.

idanyOptional

The unique ID of the match.

schemeanyRequired

The scheme to use when matching with other players.

scopeanyOptional

An optional scope for the match. For example, if the match were part of a tournament, it could be scoped to the unique ID of the tournament.

lastUpdatedTimestampanyOptional

The time of the last modification of the match.

gameIdanyOptional

The system-assigned game ID of the match. Null until the match is successfully made.

metadataanyOptional

Additional arbitrary metadata that is attached to the match.

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/match HTTP/1.1
Host: localhost:8080
Authorization: YOUR_API_KEY
Content-Type: */*
Accept: */*
Content-Length: 2560

{
  "id": null,
  "scheme": null,
  "scope": null,
  "player": {
    "id": null,
    "user": {
      "id": null,
      "name": null,
      "firstName": null,
      "lastName": null,
      "email": null,
      "primaryPhoneNb": null,
      "level": "UNPRIVILEGED"
    },
    "application": {
      "id": null,
      "name": null,
      "description": null,
      "gitBranch": null,
      "scriptRepoUrl": null,
      "httpDocumentationUrl": null,
      "httpDocumentationUiUrl": null,
      "httpTunnelEndpointUrl": null,
      "attributes": null,
      "applicationConfiguration": {
        "id": null,
        "category": "MATCHMAKING",
        "uniqueIdentifier": null,
        "parent": {
          "id": null,
          "name": null,
          "description": null,
          "gitBranch": null,
          "scriptRepoUrl": null,
          "httpDocumentationUrl": null,
          "httpDocumentationUiUrl": null,
          "httpTunnelEndpointUrl": null,
          "attributes": null,
          "applicationConfiguration": {
            "id": null,
            "category": "MATCHMAKING",
            "uniqueIdentifier": null,
            "parent": "[Circular Reference]",
            "productBundles": [
              {
                "productId": null,
                "displayName": null,
                "description": null,
                "productBundleRewards": [
                  {
                    "itemId": null,
                    "quantity": null
                  }
                ],
                "metadata": null,
                "display": null
              }
            ]
          }
        },
        "productBundles": [
          {
            "productId": null,
            "displayName": null,
            "description": null,
            "productBundleRewards": [
              {
                "itemId": null,
                "quantity": null
              }
            ],
            "metadata": null,
            "display": null
          }
        ]
      }
    },
    "imageUrl": null,
    "imageObject": {
      "id": null,
      "url": null,
      "mimeType": null,
      "state": "EMPTY",
      "lastModified": null
    },
    "displayName": null,
    "metadata": null,
    "lastLogin": null
  },
  "opponent": {
    "id": null,
    "user": {
      "id": null,
      "name": null,
      "firstName": null,
      "lastName": null,
      "email": null,
      "primaryPhoneNb": null,
      "level": "UNPRIVILEGED"
    },
    "application": {
      "id": null,
      "name": null,
      "description": null,
      "gitBranch": null,
      "scriptRepoUrl": null,
      "httpDocumentationUrl": null,
      "httpDocumentationUiUrl": null,
      "httpTunnelEndpointUrl": null,
      "attributes": null,
      "applicationConfiguration": {
        "id": null,
        "category": "MATCHMAKING",
        "uniqueIdentifier": null,
        "parent": {
          "id": null,
          "name": null,
          "description": null,
          "gitBranch": null,
          "scriptRepoUrl": null,
          "httpDocumentationUrl": null,
          "httpDocumentationUiUrl": null,
          "httpTunnelEndpointUrl": null,
          "attributes": null,
          "applicationConfiguration": {
            "id": null,
            "category": "MATCHMAKING",
            "uniqueIdentifier": null,
            "parent": "[Circular Reference]",
            "productBundles": [
              {
                "productId": null,
                "displayName": null,
                "description": null,
                "productBundleRewards": [
                  {
                    "itemId": null,
                    "quantity": null
                  }
                ],
                "metadata": null,
                "display": null
              }
            ]
          }
        },
        "productBundles": [
          {
            "productId": null,
            "displayName": null,
            "description": null,
            "productBundleRewards": [
              {
                "itemId": null,
                "quantity": null
              }
            ],
            "metadata": null,
            "display": null
          }
        ]
      }
    },
    "imageUrl": null,
    "imageObject": {
      "id": null,
      "url": null,
      "mimeType": null,
      "state": "EMPTY",
      "lastModified": null
    },
    "displayName": null,
    "metadata": null,
    "lastLogin": null
  },
  "lastUpdatedTimestamp": null,
  "gameId": null,
  "metadata": null
}
{
  "code": "text",
  "message": "text"
}