API v2 - question on what info I can set for an episode

I’m looking at using the API to create new episodes.

It looks like it is a two step process.

1 - use an http POST request to create the episode.

2 - Use the id from the newly created episode and send a PUT or POST request to update that episode and put in the episode’s data.

Maybe I am just blind, but looking over the docs, I don’t see a field to set for the date I want the episode to publish. I also don’t see the field I would set for the main body of the episode’s text, where I would dump show notes/etc.

Are those two fields available on the API?

You are right, the episode creation process is a two step process.

The Podlove episode is a custom post type and some of the data store in the posts data structure from WordPress e.g. status (draft, publish, …). This kind of data is normally expose due to the WordPress posts API, but unfortunately not for the custom post types. We do not currently expose this data to our API endpoint. I will make up for this in one of the next versions.

In which field to you add the shownotes normally?

I just use the main post content as shownotes. Usually, I have that info as markdown-formatted text that I copy and paste into the editor on wp-admin.

Actually you can set the standard wordpress data also for custom post types. I do that with my script to schedule a wordpress blogpost.

This is how I set the featured media, schedule date and content of my podlove episode using the wordpress api

postData="{ \"featured_media\": $featureMedia, \"title\":\"$fullPostTitle\", \"status\": \"future\", \"date\": \"$postDate\", \"slug\": \"$postNumber\", \"content\": \"<!-- wp:paragraph -->$description<!-- /wp:paragraph --> <!-- wp:paragraph -->$content<!-- /wp:paragraph -->\" }"

response=$(curl --silent -X POST https://laufendentdecken-podcast.at/wp-json/wp/v2/episodes/$postId \
    --header "Authorization: Basic $apiKey" \
    --header 'Content-Type: application/json; charset=utf-8' \
    --data-raw "$postData")

For setting podlove specific data like enabling assests, adding chapters etc. I use the podlove endpoints.

You can find the entire script here; laufenentdecken-cli/src/blogpost_command.sh at master · floriankimmel/laufenentdecken-cli · GitHub

1 Like

Thank you Florian for the clarification.

That’s perfect, thanks.

A little bit self promotion. I created a little terminal tool to automate publishing an episode. That’s where I also automated creating wordpress blogposts with podlove and much more. If that is interesting for you, you can check it out on github: GitHub - floriankimmel/podflow