Checking user's subscription before any action?

Then we need to retrieve all users from the server which is not good.

That is what it appears to be at this time. The app would also have to have the users:read scope for the token in question too.

I think @anon29275264 is right. It makes sense. This solution is straightforward and seamless. Downloading all users for each load and doing calculation based on users count is anti-pattern and costy I think. Besides, it requires users:read scope which contains PII data.

@dipro and @Matias.Monday I have another question. The app_subscription query is returning an array. How many records it returns and how can I decide which is the current one?

        query{
          app_subscription{
            days_left
            is_trial
            plan_id
            renewal_date
          }
        }

Hello everyone!

Our team is working on a solution for this as we speak. I will of course keep you posted!

@apsimos app_subscription will return an array with one object only.

Heads up, we will expose the number of active users on an account via the API next week.

So you will not have to query the list of users on the account. Current plan is to expose it as a field on the Account object.

I’ll share an update here when it’s deployed!

Quick note about scopes – before the change in how we count users, apps would use Account > Plan > Max Users to get the number of users. So this API update will not require additional scopes @anon29275264

@apsimos @anon29275264

2 Likes