List subtitle/chapter tracks
const url = 'https://example.com/wp-json/wp2/media-subtitles-timecodes/v1/attachments/1/tracks?parsed=0';const options = {method: 'GET', headers: {'X-WP-Nonce': '<X-WP-Nonce>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/wp-json/wp2/media-subtitles-timecodes/v1/attachments/1/tracks?parsed=0' \ --header 'X-WP-Nonce: <X-WP-Nonce>'Lists subtitle and chapter (timecode) tracks on the attachment. Query parsed=1 also parses VTT/SRT into cue structures.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Numeric entity id.
Query Parameters
Section titled “Query Parameters”1 = parse VTT/SRT into cues.
Responses
Section titled “Responses”object
Media library attachment ID.
Subtitle/chapter tracks array.
object
Field “kind” as returned or accepted by PHP.
Dynamic Shortcode island source.
Field “srclang” as returned or accepted by PHP.
Product label.
Field “default” as returned or accepted by PHP.
Example
{ "tracks": [ { "kind": "subtitles" } ]}Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Insufficient capability or invalid REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}