Woocommerce Membership REST API check if user has a membership plan - wordpress

I ma developing a mobile app with a wordpress backend that was developed by someone else and the person is unreachable. I have the usual Woocomerce membership plans built on the backend. The website works perfectly fine. The issue is this
I checked the REST API endpoints through 'discovery' and found all the usual endpoints, but my issue is how will i test the if the user has a membership plan via REST API. I have already wasted a lot of time figuring out the solution.
/wc/v3/memberships lists all the endpoints
/wc/v3/memberships/plans/ lists all the plans
when i make a call to all these endpoints, it gives me all the users which have memberships.
My question is how would i know if the current loggedin user has purchased a membership, there is no such specific endpoint to it, plus the docs are not very specific. They are vaugue. Good enough for a beginner but not for a production level.
This is the url which i am referring to, which i got from the "official" Woocomerce Membership website
https://skyverge.github.io/woocommerce-memberships-rest-api-docs/#get-user-memberships

Use this endpoint :
GET http://example.com/wp-json/wc/v3/memberships/members/
Just replace with current user id. you can get current user id through this endpoint :
GET http://example.com/wp-json/wp/v2/users/me

Related

Request to retrieve by an API the profile URL (vanity name)

We're applaime - developing an AI driven product which will help job seekers to manage more effectively the job application process.
The product will enable Linkedin oauth authentication after which it is expected to retieve the current user's basic profile.
Hence we would like to apply for this permission (r_basicprofile). How can we get this process in motion?
Thanks.
Trying to fetch the basic profile via an API. Need permission for that.
This page describes how to get access to the various APIs: https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access.

Is there an API that allows a candidate search query?

We're looking into integrating with LinkedIn so that we can feed our users with lists of job candidates, and then send our users back to LinkedIn in order to view relevant profiles. I'm not seeing any relevant API docs regarding this. Is this something that is possible to do via your API today or in the near future?
Right now, LinkedIn gives only the scope of r_liteprofile and r_emailaddress to Retrieve authenticated member's name, headline, photo, and member's primary email address.
To get the relevant candidate for the job, you may need to check skills, projects, etc, for that you need the permission of r_fullprofile,
LinkedIn API has restricted such information as per their documentation:
https://learn.microsoft.com/en-us/linkedin/shared/references/v2/profile/full-profile
As per their documentation, to access the information of skills, address, etc, your app needs to request r_fullprofile. But they have closed it now and no alternate is given. The more detail about the current permissions from LinkedIn can be seen here:
https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access
Right now there are currently in development mode. They are working on developing their APIs. What and when they will release such information is not available to document right now.

How do I use a web hook using Stripe and ARMember in Wordpress

I am working on a project with a third party website, in which I will create a membership recurrent plan, gather customer's information, store it, and charge the customer. Upon subscribing, the customer's credentials and information will be passed via an API to a third party website, where they will be able to access the service.
For the membership setup on my website, I am using ARMember, which is connected to a Stripe account. I am working with a developer for the whole API setup with the 3rd party website, but as a requirement, my developer is asking me to provide the webhooks We need a hook that can give user-object or user-signup details after the successful payment event.
Forgive me for being a newbie, as I am not a developer nor anything close to that. I have never worked with webhooks before.
In looking into ARMember's webhook documentation I found this, which I believe it is what my dev needs, arm_payment_gateway_validation_from_setup, however, there are no clear instructions on what to do with this, or how to use it. I guess they assume users seeking webhooks know exactly what to do with them, which is not my case. Please help anyone! Will be so grateful!

Is it possible to integrate google analytics dashboard to our own website?

I want to show google analytics dashboard to my users. It is not possible to give access of "google analytics dashboard" to all users. So I want to integrate it on my own website. Will it be possible to integrate google analytics dashboard on a particular website?
This question gets asked quite a bit. It is important to understand the security model for the API. All Google APIs use OAuth2.0 to authenticate the user. This is designed to make it easy to use the API to access the Users's data on behalf of the user. In contrast you will need to do work to show Your data to your users.
With that said, an example of what you are looking for is the Server side Auth example provided by the Analytics API team.
The simplest answer is to query the API on the server side, with a service account and serve that data as you serve any other data to your users. Read the scenarios in detail, and pick one that best suits your end goals. Understand how the API views the following entities.
A User uses an application.
A Developer develops Application.
An Application has a project id and its associated credentials.
A user authorizes an application to access their data via the API.
You are breaking this paradigm because you are the user and developer from the API's perspective. You want to share your data with people who are not authorized to view it, so you will need to use a service account to access that data and share it directly with your users.
Also remember to add the service account to Analytics View you wish it to access.
Check out EmbeddedAnalytics if you prefer not to get bogged down learning oAuth2, the CoreReporting API, and lastly a charting tool. We simplify the process. All you do is create your chart and embed a snippet of code in your site where you want the chart/dashboard to show.

LinkedIn New API - Can't Get r_network Permission

I inherited a program that was written with the old LinkedIn API, and I'm trying to migrate it to the new API. When I try to get the r_basicprofile permission, my oauth token works. However, when I try r_network or rw_nus, I get a response
invalid scope -- your application has not been authorized for
r_network.
Yet, when I go to www.linkedin.com/developer/apps/xxxx/auth, the boxes for r_network and rw_nus are checked.
I.e., A request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_basicprofile&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
works, but a request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_network&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
gives that error. What am I doing wrong?
As of May 15,
After the grace period expires, several REST API endpoints will no longer be available for general use. The following endpoints are the only ones that will remain available for use:
Profile API — /v1/people/~ `
Share API — /v1/people/~/shares
Companies API — /v1/companies/{id}
If your application is currently using any other API services (e.g. Connections, Groups, People Search, Invitation, Job Search, etc.) you will have to apply to become a member of a relevant Partner Program that provides the necessary API access to continue to leverage any of the endpoints that are not listed above.
It looks like linkedin no longer wants to share anything with their API. Creating a new app indicates that the only possible options are r_basicprofile, r_emailaddress, rw_company_admin, and w_share:
TLDR: they have locked down the API and restricted the usage to an extremely limited set of access points.
I did some more digging. The linkedin website is misleading. On my app linkedin page, it says that I'm approved for rw_nus and r_network, but on this page
https://developer.linkedin.com/support/developer-program-transition
it says those are no longer approved.
So the app home page in linkedin incorrectly said I had those permissions.
Heres the link if you want to Apply for Linkedin
https://help.linkedin.com/app/ask/path/api-dvr

Resources