Fill in the Blanks

Adding .h5p activities programmatically to Drupal 8 nodes

Forums: 
I am using the H5P Drupal 8 module and am trying to inserting .h5p zip archives into newly created nodes through a script in a custom module.

I have tried to use the following code and am passing (to my knowledge) a complete $h5p_content array:

$H5PObj = H5PDrupal::getInstance();
$result = $H5PObj->insertContent($h5p_content, $contentMainId = NULL);

Am I missing something ? Do I need to call another function aside from insertContent()?

Pages