I want to attach an React native app to a Wordpress E-Learning Portal (leveraging the LearnPress-Plugin) to authenticate enrolled students and download audio assets of the course to the app.
The Plugin uses custom post types for courses & lessons.
So after authentication I use the Media Query to retreive the audio assets via Rest Media API
I want to retreive all media assets attached to a certain lesson Id, so I use the parent
argument in the query:
/wp-json/wp/v2/media/?media_type=audio&parent={LESSON_POST_ID}
I get empty results.
If I attach the media files to a regular wordpress post, the query works fine
/wp-json/wp/v2/media/?media_type=audio&parent={SOME_REGULAR_POST_ID}
So I guess the problem is that the lessons are custom post types?!
Do you have any solution or any workaround for this?
I could attach all needed media files to a regular post and query for them, but then I need to hardcode the post-id into the app, which I would like to avoid.
Thank you in advance!
Additional info
I attach the media items via AdminPanel->Media
This leads to an insert of the corresponding post_parent Id in the DB.