imat Thu, 09/10/2015 - 10:42 Forums Developing Opigno Hello, Is it possible to programmatically enroll students in a course? James Aparicio Thu, 09/10/2015 - 10:55 Hi imat, Hi imat,Ofc, http://www.drupalcontrib.org/api/drupal/contributions!og!og.module/function/og_group/7Best regards imat Thu, 09/10/2015 - 11:10 Thank you James, Thank you. I mean I need to programmatically enroll a student on a specific course and put a user expiration on it. Is there a method or API that I can use on Opigno? Thanks again! James Aparicio Thu, 09/10/2015 - 11:17 Hi imat, Hi imat,Yes, if you have the opigno user expiration app installed then the memberships will have a user expiration field.That function registers a user to a group and returns the membership it created. Group type is node and gid is the nid of the course, the entity is the user.After that just set the membership expiration date and save the membership.Something like:$membership=og_group(...);$membership->expirationdatefield="...";og_membership_save($membership);http://www.drupalcontrib.org/api/drupal/contributions%21og%21og.module/function/og_membership_save/7Best regards imat Mon, 09/21/2015 - 09:51 Thanks Thank you! imat Mon, 09/21/2015 - 09:51 Thanks Thank you!