Im doing some testing with course creation with the php valence api, everything works fine on course creation but the path information isn't correct, for whatever reason it just creates a folder in enforced with the name as the course code. Am I missing something?
$rand_course_id = rand( 99999, 999999);
echo $rand_course_id;
$json = '{
"Name": "Valence '.$rand_course_id.'",
"Code": "VALENCE_'.$rand_course_id.'",
"Path": "/content/enforced ",
"CourseTemplateId": "6722",
"SemesterId": null,
"StartDate": null,
"EndDate": null,
"LocaleId": null,
"ForceLocale": "false",
"ShowAddressBook": "true"
}';`
mphs_json_request('courses',$json);
There is a config variable that forces the paths of course content into a particular form. The variable is d2l.Tools.CMS.CoursePathEnforced. Perhaps this value is on in your system?