🤑 Enable Users to Subscribe to Your Glide App Using Payhere + Call API Columns

:wave: Hey fellow Gliders

In this video, learn how to utilize Glide Call API and Payhere payment gateway to enable your users to easily subscribe and access premium features within your app.

:tada: No more Make. No more Zapier.

This video covers:

  • Glide Call API and Payhere: no more middleman needed in order to create a smooth subscription experience
  • Setting Up Payhere Account: set up user-specific payment plan links
  • Glide App Configuration: configure Call API columns, create a user-friendly subscription screen, and design an intuitive subscription flow
  • Handling Subscription Status: manage subscription statuses using the Glide Call API. Grant access to premium content only for subscribed users

One note is that at 25:25, I discuss a technique known as cache busting in order to refresh the endpoint in order to fetch the latest subscription status. In the video I use the “now” value which would effectively call the API every 10 seconds = LOTS of updates.

To mitigate, you can use a Math column to update, let’s say, every 24 hours. Use a math column to calculate a daily value YEAR(D)*10^4+MONTH(D)*10^2+DAY(D) where D is now. Then use this value instead of now.

:popcorn: Enjoy!

9 Likes

Thank you for sharing!

May be a silly question, can we Call Glide API using this column? I want to add multiple rows based on various conditions. Currently, we have to use Make to iterate it and adding multiple rows using Glide API. Can we skip Make in my use case using Call API column by any chance?

1 Like

Yes, you can. Here is how:

5 Likes

Thank you for sharing. Are you saying, I will be able to do following action (add rows based on numbers) using Call API column and Glide API?
image

If yes, can you help me set up this or share code to be used in this?

I am really to sorry to ask this but I clearly don’t understand any codings/api, I am still trying to learn.

Yes, exactly.
But instead of all those conditional branches in your action, you can do it with a single API call, regardless of the number of rows to be added. It’s just a matter of preparing all the mutations, joining them together, and then sending the API call - just like in my example.

Why don’t you try it for yourself first?
You might find that it isn’t as difficult as you think it is.
I can’t give you specific instructions, as every use case will be slightly different. But the video I shared - and especially Bob’s tutorial - shows you the general approach. You just need to take that and apply it to your own situation.

1 Like

What you did at minute 1:35 was a game changer for me, I didn’t know it was possible to copy and paste multiple lines that way

what is the command to do multiple row copy and paste? I try highlight columns to copy and then use ctrl C and ctrl V, but unsuccessful.
TQ.

Call API will use 1 update each time you call it to fetch new data, so I advice against configuring it to invalidate every 10 seconds by putting the current timestamp in the URL!

2 Likes

Ctrl-c/Ctrl-v (Windows) or Cmd-c/Cmd-v (Mac) should work.
Note that you can only paste values into non-computed columns (obviously).

1 Like

That’s good to hear. I am happy that I asked that question.

Yes absolutely, I will try from my end. Your video is a good start for me to understand it. Thank you so much the help. I will get back to you if I need any help.

Hi Darren,
I cannot understand why I am having so much difficulty to copy multiple rows like what you have shown. My process is like this.

  1. Highlight rows to copy (non-computed column). Press Ctrl-C to copy
  2. Click on row (non-computed column) to paste and press Ctrl-V

I cannot paste into individual columns. However, if I double-click on a cell (meaning I enter the cell) and do Ctrl-V, then all the copied rows will be pasted. But this is pasting, eg 3 rows of value into a single cell.

Any other suggestions? Is there a system setting I need to change?

Thank you

I don’t know. It should work if you do it as you described. That said, a few of us have been noticing some odd behaviour with copy/paste recently, so maybe there is a gremlin in there somewhere :man_shrugging:t3:

2 Likes

just in case anyone has same issue … need to go to your browser privacy setting and allow site to see what has been copied to clipboard … now efficiency will improve

I know you mentioned to replace the Now → Current Date in the End Point → Customer ID Construct URL with that Math formula, but I noticed that there is a “Refresh after” which states that if nothing is set, the data will be refreshed after 30 days. Is this a substitute for the Now? Should we make this 1500 (24 hours * 60 minutes) so it refreshes daily?

I know I have it set for 1 minute to force an instant change I was testing.

Yes. This field wasn’t available at the time of the video.

1 Like

Great! Follow up question, if a new user subscribes, will their status update immediately or only after the Call API triggers, which could be up to 24 hours? If its up to 24 hrs, is there a way to force the Call API to trigger through an action/button?

How about using a query field that isn’t “harmful” (like you can set anything to it and it won’t affect the ability to return data from the endpoint), then point it to a user-specific column? Then you can set a random ID to that field when the user clicks a button, and hopefully that forces Call API to run again since there’s a change in the input.

So add a User Specific Column, map it to the Query in the Call API and then have a button with set column action to “complete” their subscription and force the change?

Yeah, I think so.

1 Like