Your Knowledge Base is moving on 3/25/24! Our new Help Center provides all the articles you know and love (plus so much more) in a one-stop shop. Ask your SPoC for details!

Swagger UI

 

Swagger is an open source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful Web services built on the OpenAPI Specification. The Swagger UI framework allows developers and non-developers to interact with the API in a sandbox UI that gives insight into how the API responds to parameters and options.

Accessing the Swagger UI

The REST API is exposed at the root of the API Url. You can find this url by adding "/ministryplatformapi/" after your specific domain:

https://{your platform domain}/ministryplatformapi

A Swagger link is provided on the api landing page or it can be access directly by adding "swagger" to the url

https://{your platform domain}/ministryplatformapi/swagger

Your First Query: Available Tables

For your first query, return all of the tables which are exposed to you via the REST api. This will depend on the Security Roles granted to your user.

1. Click on GET /tables to Expand this endpoint

2. Authorize use of the end-point

In order to utilize the api, you must supply credentials proving you have permissions and set the scope for the end-point.

First, click the ON/OFF button to begin the process of Authorization/Authentication

Second, select the "all" scope and select "Authorize"

Third, login to the platform. You will be prompted for your username and password. This will Authorize you to use the REST api and determine which records (Pages) you have access to (via your Security Roles).

The end-point will be enabled if you login successfully with the proper permissions.

3. Run the Query using the "Try it out!" button

4. Study the Results

The results will show in addition to the request url, response code, and headers. The Response Body is in JSON and will list all tables you have access to via your User permissions.

Your Second Query: Future Events

For your second query, return records for a specific table using the /table/{table}

Table

Any table returned by the previous query is a valid table. 

Fields

Any fields returned by the previous query are valid fields for the parent table. Any fields generated by the Advanced Search Tool are also valid, including the Table Lookup Convention.

Filter

This is a valid SQL string representing the WHERE clause of a SQL query. Most SQL is supported here, but there are limits imposed by the API.

Example: Events

  • Table = "Events"
  • SelectFields = "Event_ID, Event_Title, Event_Start_Date, Event_End_Date, dp_fileUniqueId AS FileID"
  • Filter = "Event_End_Date < GETDATE() AND Cancelled = 0 AND [_Approved] = 1"