I know there's an example script that does basically this, but we only have access to the username, not userid, so the script will need to get the ID from the name.
You can use another controller to get user_id from username http://www.amember.com/docs/REST#Users Code: http://example.com/amember/api/users?_key=APIKEY&_filter[login]=username In response you have user_id and you can use it to add access to user account: http://www.amember.com/docs/REST_API_examples#Add_access_record_only Reference: http://www.amember.com/docs/REST