Enabling new settings on the back-end via REST client (for custom websites)

For those that are using a custom website, and are not receiving the automatic updates to the platform, you may want to use some of the new back-end settings that we are enabling on our other websites that receive continuous updates.

In this article, we will show you how to access the new back-end settings, and show you how to enable such a setting (that is not visible on your UI, because you skipped updates) by using Insomnia REST client. Note that you can use other REST clients such as postman too.

Note: This is only for those who would like to enable a new back-end feature on their custom website that does not get automatic updates.

Step 1. Download Insomnia REST client

No matter what environment you are using, you have the ability to download Insomnia REST client.

Screenshot from 2018-09-05 17-07-10

Once you have downloaded Insomnia, you will be required to create an account.

Screenshot from 2018-09-06 10-24-38

Step 2. Go to the API docs

Once you have created your Insomnia account, you can choose the back-end setting that you would like to enable by referencing our demo website’s API doc.

Note: The reason why you are referencing this API doc instead of your own, is because you are not receiving automatic updates on your front-end and therefore, you will not see any updates on your API doc. You are, however, using the same backend API code, so you can see all of the newest updates on the demo websites API doc.

Screenshot from 2018-09-05 15-28-35

For this example, we will be enabling the setting called Keep Campaign Status

Screenshot from 2018-09-05 15-32-10

Above is a screenshot of the setting displayed in the Administrator dashboard, which you will not see on your platform when you are not receiving automatic updates.

Step 3. Finding the setting

In order to know what you are changing via Insomnia or API request, you need to figure out which setting to change. As mentioned previously, we are trying to change the Keep Campaign Status field. There are 2 ways to do this.

A. Find the setting in the source code or controller. If you are unsure of which controller you need, you can always ask us which controller you will need to use in the code by creating a support ticket or joining our Discord chat.

Screenshot from 2018-09-05 14-45-10

 

B. Note that if you are excluded from updates you still have the ability to track the master repository on your local machine or your own server, and log in, as the portal administrator so you can see any updates that you may have missed. If you cannot access the master repository please contact us to request the access.

After logging in as a portal administrator, and going to the portal settings, then to the campaign settings, you can scroll down and see the following Keep Campaign Status setting.

Right-click and inspect the element where the checkbox is. The setting name will be what follows after ng-model. Now that we know the setting name, we will proceed to Authentication and Update steps.

Screenshot from 2018-09-06 14-50-52

Step 4. Authenticate – Send POST request

To gain the ability for enabling a setting on your API, you would have to first be authenticated as portal administrator.

To be authenticated, you would have to create a POST request and using the Multipart option. So log into your new Insomnia account, and use the authenticate URL. Your URL will include your project name then include “yourdomain.com/api/service/restv1/authenticate” or “yourproject.atlas.thrinacia.com/api/service/restv1/authenticate“. Also, make sure to provide username and password (admin account).

authenticate-01

 

Create the POST request.

authenticate-1

You will receive the authentication token on the right-hand side of the screen.

Step 5. Update the Setting – Send PUT request

Next, once you are authenticated you will have to create a PUT request to the the endpoint ending in https://yourproject.atlas.thrinacia.com/api/service/restv1/portal/setting using the JSON option. This way, you can enable the setting you want (Keep Campaign Status).

put-request

To update the portal settings you can enter raw JSON as the payload like below.
Screenshot from 2018-09-05 16-24-38

Recap: You can easily enable a back-end setting on a custom platform by doing the following:

  • Download Insomnia
  • Find the setting
  • Authenticate ( POST Request )
  • Settings Update PUT request

Now you can easily enable any back-end settings for your custom Crowdfunding portal without receiving automatic updates.