Home › Forums › Legacy Support › Support queries › API methods
- This topic has 7 replies, 2 voices, and was last updated 1 month, 4 weeks ago by
Anshuman Sahu.
-
AuthorPosts
-
September 25, 2023 at 3:10 am #389779
Upface tech-admin
ParticipantHello!
We would like to integrate Hotmart Webhooks to Woocommerce and WPLMS.
So we need to know how to do it with API (which methods, documetation,etc):
1. Add student to course
2. Remove student from course
3. Add more time which user could be presented on the course (I think the best idea is add more time by api request and do not use wplms subscriptions at all)
Thank you
September 25, 2023 at 9:46 pm #389804Anshuman Sahu
Keymasterwell i think there wont be any need , in wplms when user purchased product course access is provided .
still if you want follow : https://vibethemes.github.io/wplms-docs/developer-guide.html
September 26, 2023 at 6:45 pm #389823Upface tech-admin
Participantok, for NEW users we could create woocommerce orders, no problem
but:
1) How to extend subscription or add more time by API? User will exted his subscription in the Hotmart APP and we need to do same by API in WPLMS
2) How to remove users from course? If user cancelled subscription in Hotmart APP, we need to do same by API here.
3) Will WPLMS assign course if Woocommerce order will be created by API (or from admin panel), not by /checkout page?
So, we need to sync third-party app (Hotmart) with WPLMS (add students, remove students, add more time on subscription,etc).
Hotmart provides all webhooks we need, so here problem is how to do this on WPLMS side.
Thank you.
September 27, 2023 at 9:27 pm #389853Anshuman Sahu
Keymaster1,2 . all api's are not not directly available . . also for this user need to authenticated via token. please check these docs: https://vibethemes.github.io/wplms-docs/developer-guide.html
3) Will WPLMS assign course if Woocommerce order will be created by API (or from admin panel), not by /checkout page? : YES .
September 29, 2023 at 5:32 am #389892Upface tech-admin
Participant1,2 - https://vibethemes.github.io/wplms-docs/assets/images/demo/findclientid.png this tokens? If yes, okay, we could create tokens. But how to add student, extend time and remove students by api? Could you send me specific api methods to do it?
September 29, 2023 at 9:40 pm #389905Anshuman Sahu
KeymasterIm sorry these api's are not available as of now , you can create your own rest api in worpress in wplms .
to remove student you can use this function :
bp_course_remove_user_from_course($member_id,$course_id);
course expirty time saved in usermeta with meta_key as {Course-id} and meta_value is the timestamp when the course going to be expired.
to adjust the time there is a usermeta :
$t = time()+(30*86400);//currenttime + 30 days converted into seconds
update_user_meta($user_id,$course_id,$t);
this means the course is extended to 30 days
October 2, 2023 at 12:52 am #389939Upface tech-admin
ParticipantWill the subscription extended if I create second order?
for example:
1 order: 1 month of subscription
2 order (after 10 days): 20 days of subscription (from 1 month) + new 1 month?
October 3, 2023 at 10:00 pm #389983Anshuman Sahu
Keymaster2 . well it when your purchase 2nd time at from that current time(when user orders) it will add more 30 days no matter how many days past when course was expired.
-
AuthorPosts
- You must be logged in to reply to this topic.