Stadium
  • Home
  • Academy
  • How it works
    • Designer
    • Application Manager
    • Application users and roles
    • Designing applications
    • User API
  • Features
    • Application
    • Create a Form
    • Embedded Files
    • Events
    • Expression Editor
    • Pages
    • Preview
    • Publish
    • Scripts and Event Handlers
    • Session Variables
    • Settings
    • Styles
    • StyleSheet
    • Templates
    • Types
    • Validations Cheat Sheet
  • Connectors
    • Database Connector
    • File System Connector
    • Web Service Connector
  • Controls
    • Button
    • Chart
    • Checkbox
    • Checkbox List
    • Container
    • Data Grid
    • Date Picker
    • Drop Down
    • Flexbox
    • Grid
    • Image
    • Label
    • Link
    • Menu
    • Panel
    • Radio Button List
    • Repeater
    • Table
    • Text Box
    • Upload File
  • Actions
    • Async
    • Call Web Service
    • Decision (If/Else)
    • Display Message Box
    • Download File
    • For Each
    • Java Script
    • Navigate To Page
    • Notification
    • Set Value
    • Variable
    • While
  • Release Notes
    • 6.12.3272
    • 6.12.3270
    • 6.12.3268
    • 6.12.3264
    • 6.11.3223
    • 6.11.3221
    • 6.11.3220
    • 6.11.3218
    • 6.11.3210
    • 6.10.3155
    • 6.10.3151
    • 6.9.3102
    • 6.8.3100
    • 6.7.3096
    • 6.6.3082
    • 6.6.3081
    • 6.6.3080
    • 6.6.3075
    • 6.5.3055
    • 6.4.3036
    • 6.4.3034
    • 6.4.3033
    • 6.3.3019
    • 6.2.2999
    • 6.2.3001
    • 6.1.2990
    • 6.0.2972
    • 6.0.2970
    • 6.0.2969
Powered by GitBook
On this page
  • Setup
  • Operations
  • Fetch All Users
  • Fetch User
  • Add User
  • Update User
  • Delete User
  • Fetch Roles

Was this helpful?

  1. How it works

User API

PreviousDesigning applicationsNextFeatures

Last updated 1 month ago

Was this helpful?

Stadium applications with Authentication mode Email & Password or Single Sign-on come with a REST API that can be used to remotely manage application users.

Setup

Calling the application User API requires a key. Generate this key in the Stadium Application Manager (SAM) under the application's User API section.

Here you can also download an Open API definition file. When importing this file into Stadium, Linx or a number of other applications, a Web Service will be generated with all available User API operations and types.

Operations

The API exposes the operations below

Replace the <api-key> placeholder in the URL's below with the key you generated for your application. Replace the <application-url> placeholder with the base url of your site (e.g. server.com/myapplication)

Fetch All Users

Returns a Json object containing all users. Use a querystring parameter "email" to filter the results by email.

URL

https://<application-url>/api/users?key=<api-key>&email=@example.com

Method

GET

Example Response (application/json)

[
    {
        "id": "2e718832-3669-43f3-8eae-75f30360c17d",
        "email": "mike.carter23@example.com",
        "name": "Mike Carter",
        "username": "mike.carter23@example.com",
        "isAdministrator": true,
        "roles": [
            "User",
            "Developer"
        ],
		"data": {}
    },
    {
        "id": "d02123fd-730d-4c93-a9c9-e0ee4270e94d",
        "email": "loretta.pearson50@example.com",
        "name": "Loretta Pearson",
        "username": "loretta.pearson50@example.com",
        "isAdministrator": false,
        "roles": [
            "User",
            "Team Leader"
        ],
		"data": {}
    }
]

NOTE: The data object is used in the Single Sign-On process by Stadium and is not available to API users.

Fetch User

Returns a Json object containing the details of a specific user

The UserID is generated by Stadium and can be retrieved using the Fetch User API call

URL

https://<application-url>/api/users/<USERID>?key=<api-key>

Method

GET

Example Response (application/json)

{
    "id": "d02123fd-730d-4c93-a9c9-e0ee4270e94d",
    "email": "loretta.pearson50@example.com",
    "name": "Loretta Pearson",
    "username": "loretta.pearson50@example.com",
    "isAdministrator": false,
    "roles": [
        "User",
        "Team Leader"
    ],
	"data": {}
}

NOTE: The data object is used in the Single Sign-On process by Stadium and is not available to API users.

Add User

Creates a new user record

URL

https://<application-url>/api/users?key=<api-key>

Method

POST

Content Type

application/json

Body (example)

{
	"email": "<EmailAddress>",
	"name": "<Name>",
	"password": "<Password>",
	"roles": ["<Role1>", "<Role2>"],
	"isAdministrator": true
}

Example Response (application/json)

{
    "userID": "efd1251c-d986-4d52-bf61-38b7b384958b"
}

Update User

Updates an existing user record

The UserID is generated by Stadium and can be retrieved using the Fetch Users API call

URL

https://<application-url>/api/users/<USERID>?key=<api-key>

Method

PUT

Content Type

application/json

Body - all fields are optional (example)

{
	"email": "<EmailAddress>",
	"name": "<Name>",
	"password": "<Password>",
	"roles": ["<Role1>", "<Role2>"],
	"isAdministrator": true
}

Delete User

Deletes an existing user

The UserID is generated by Stadium and can be retrieved using the Fetch Users API call

URL

https://<application-url>/api/users/<USERID>?key=<api-key>

Method

DELETE

Fetch Roles

Returns a Json object containing all available roles

URL

https://<application-url>/api/roles?key=<api-key>

Method

GET

Example Response (application/json)

[ "Developer", "Team Leader", "User" ]