API

  • Kush Ed
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #118067 by Kush Ed
API was created by Kush Ed
Please share the mem pro API documentation for an external software to read-only retrieve the subscription plans of a user by passing the membership number(which is a custom field).

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #118074 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic API
Hello

Unfortunately, we don't have an API like that. So you will need to implement the API yourself

Try to look at API controller components/com_osmembership/controller/api.php to see how we implemented some basic API and implement the API you need yourself:

To use APIs, you need to:

1. Go to Membership Pro -> Configuration, set Enable API config option to Yes. Enter the API Key into API Key config option. You need to pass that key in every API request

2. The request will be made to this URL (depends on the API you want to call)

domain.com/index.php?option=com_osmembership&task=api.get&id= [SUBSCRIPTION_ID]&api_key=[API_KEY]

domain.com/ needs to be replaced with your site domain
[SUBSCRIPTION_ID] is ID of the subscription record to get data (the data you pass here depends on the API method you call)

[API_KEY] is the API Key you entered in Configuration. It's used to validate every API request before perform the required action

Hope it gives you some clues

Tuan
The following user(s) said Thank You: Kush Ed

Please Log in or Create an account to join the conversation.

  • Kush Ed
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago - 6 years 9 months ago #118131 by Kush Ed
Replied by Kush Ed on topic API
Hi Tuan,

thanks, this is helpful.
1) I tried the below but data shows even without the API key?
2) how do i get the variable names etc of the mempro to use to build a API function, is there any documentation.
Last edit: 6 years 9 months ago by Kush Ed.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #118133 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic API
Hello

1. Look like you are not using latest version of Membership Pro ? The API code was only supported recently

2. We don't have documentation for it. This is something you will have to build it yourself depends on what you want the API to do/return data for you. You need to know Joomla programming, understand Membership Pro data structure to implement your custom API. As mentioned, you can look at components/com_osmembership/controller/api.php to see some basic API methods which I implemented for the extension and implement custom api for your need

Tuan

Please Log in or Create an account to join the conversation.

  • Kush Ed
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago - 6 years 9 months ago #118143 by Kush Ed
Replied by Kush Ed on topic API
I am using the latest version, please check on my test site -

login details sent via support ticket

tried-
Last edit: 6 years 9 months ago by Kush Ed.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #118148 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic API
OK. I will check it and reply you with the result via support ticket

Regards,

Tuan
The following user(s) said Thank You: Kush Ed

Please Log in or Create an account to join the conversation.