A starter guide to Postman.
When creating an app through NationBuilder, you may want to test the app to ensure that it is working properly. Postman is a tool used to send requests and receive responses through our REST API, but instead of relying on curl, you can instead use a dedicated app interface to organize and save your tests. In this guide, we will only be covering the topic of attaching an app to NationBuilder, authorizing the app through Postman, and sending a test request. If you would like to check out all of the Postman features, feel free to read more here.
The following are the steps to set up Postman and authorize your new app:
- Download the latest version of Postman.
- Double click on the .zip file and extract the app (or .exe file if you are using Windows) for Postman.
- If you are on Mac, drag the Postman app into your Applications folder. If you are using Windows or Linux, double click on the installation file and follow the directions through the installation accordingly.
- Once you have installed Postman, double click on the Postman icon to open the app. You should see something like this:
- Click on "Request" to create a new basic request. We will use this to begin the setup process to authorize our new app.
Type in the name of the request, a description (optional) and select which collection you would like to house these requests. Feel free to create your own new collection to keep all of your requests for your new app in one spot.
Once you have filled out the request form, click "Save" to move to the next step.
Select the "Authentication Type" in the dropdown menu under "Type" and click on "OAuth 2.0".
- Click on "Get New Access Token" to connect your new app to Postman.
At this time, we need to go grab your new app registration credentials from NationBuilder. Login to your NationBuilder control panel and go to Settings > Developer > Register App. From there, type in your new app name, description (optional), and the OAuth callback URL that we are going to use to connect to Postman is "https://www.getpostman.com/oauth2/callback". Next, click "Register".
- Now that you have registered the app, you can connect the app to Postman using the OAuth client ID and OAuth client secret.
- Copy the OAuth client ID and OAuth client secret from NationBuilder and paste them into the Postman on the registration form from Step 8.
Make sure to use the same Auth URL and Access Token URL as shown above replacing "NATIONSLUG" with your specific nation slug that you logged into to register your app in Step 9.
- Once you click "Request Token", you will be prompted to login to your nation through the front-facing website. Go ahead and log in to your nation website with your control panel user credentials (only Admin permission sets can register apps).
- Once you have successfully logged in and registered the app with Postman, you will generate a new access token that can be used to make requests with Postman through our API through your nation.
Congratulations! Now that your app has been authorized using Postman, you can send and receive requests using the Postman UI based off of the endpoints and parameters in our API documentation!