Skip to main content

University API

Setting up your application to consume endpoints on the University API

Setup
Client Credentials
Authorization Code

Required Modules

Note: Downloading private app store modules/widgets has been turned off at the moment for certain versions due to security concerns. The latest version of private App Store content can still be downloaded from the Company Content page in the Mendix App Store and then imported into the respective versions of Studio Pro/Desktop Modeler. Once the module is downloaded, import it by right clicking Project File and clicking on Import module package.

Configuration

Firstly, make sure that you have an application in mind from api.byu.edu. If not, follow the instructions at BYU Developer Portal to get started.

Annotation 2020-01-14 092756.png

Once you have an application in mind, place the OAuth_Configuration snippet onto any page in Mendix Studio Pro. When viewed in the browser, it should look like the following:

Annotation (1).png

Input the wso2 Client ID and Client Secret for you application and click 'Save'. The instruction from here depend on which type of grant type (Client Credentials or Authorization Code) you want to include in your application.

This grant type uses the client application to consume endpoints instead of a user.

After filling in the OAuth_Configuration object, click the Get Client Token button. This should retrieve the Client access token from wso2 and store it in your database. You can use the ClientToken snippet to manage the saved token.

In order to use the token, you need to call ACT_ClientToken_GetToken before making a request to a UAPI endpoint. For example:

Annotation (2).png
Annotation (3).png

ACT_ClientToken_GetToken takes care of refreshing the token when it expires, so you shouldn't need to worry about expired tokens.

Work in progress