API methods

Home Forums Legacy Support Support queries API methods

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #389779
    Upface tech-admin
    Participant

    Hello!

    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

    #389804
    Anshuman Sahu
    Keymaster

    well 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

    #389823
    Upface tech-admin
    Participant

    ok, 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.

    #389853
    Anshuman Sahu
    Keymaster

    1,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 . 



    #389892
    Upface tech-admin
    Participant

    1,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?

    #389905
    Anshuman Sahu
    Keymaster

    Im 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

    #389939
    Upface tech-admin
    Participant

    Will 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?

    #389983
    Anshuman Sahu
    Keymaster

    2 . 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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.