Using REST API to show users with specific access rights

Discussion in 'Troubleshooting' started by bennyuk1, May 22, 2017.

  1. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    200
    Hi, I have various passwor dprotected pages cerated in wordpress that need to display various amember reports. Currently I do this via custom functions that do database queries on am_invoice_payment ,am_access , and am_product.

    I'd like to see if there is an easier way to do this via REST .

    eg is it possible to display list of users (names and emails) that have access rights via certain products?
    I say "access rights" as some will have paid , but others will have been granted permission manually without having paid.

    Thanks for any tips
    Ben
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Hello Ban,

    I am afraid it is not possible to do with REST API and I do not recommend to do it actually (by performance reason).

    It is better to query aMember database. You need to query only one table - am_access_cache.
    This table already have all necessary data to check access based on any criteria.

    Best Regards.
  3. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    200
    Thanks Caesar
    Unfortunately I need to query individual products from invoices and see how much they paid, so the query is big

    I have a solution wit a custom query but was wandering if the API was up to it.

    Thanks anyway

Share This Page