REST APIs & Upload

StreamTube adheres to the WordPress REST API standards, facilitating seamless integration and extension with third-party applications. Developers can leverage the REST API to build custom applications.

For comprehensive instructions, please refer to the official WordPress REST API Handbook: https://developer.wordpress.org/rest-api/



1. API Endpoints


2. Authentication

https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/


2.a) Application Passwords:

To learn more about Basic Authentication, visits https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#basic-authentication-with-application-passwords

Create An App Password

  • Go to your frontend Dashboard.

  • Navigate to the Account section.

  • Select App Password.

  • In the "App name" field, enter a descriptive name for the application you'll be using this password with.

  • Click the "Add New Application Password" button.

  • Save the generated password in a secure location. It will not be displayed again.

Manage App Passwords via REST API


2.b) Bearer Access Token

You can also authenticate using a Bearer Token.

Install and activate the "JWT Authentication for WP REST API" plugin: https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/ Refer to the plugin page for more details.

Generate an Access Token:

  • Access your frontend Dashboard.

  • Go to Account and select Access Token.

  • Enter your password and click "Create a token" button.

  • Remember to save the generated token in a safe place, as it will not be shown again.

Generate an Access Token from Dashboard

3. List Videos

GET https://domain.com/wp-json/wp/v2/video

General Arguments: https://developer.wordpress.org/rest-api/reference/posts/#arguments


4. Get Video

GET https://domain.com/wp-json/wp/v2/video/{videoId}

General Arguments: https://developer.wordpress.org/rest-api/reference/posts/#arguments-3


5. Update Video

POST https://domain.com/wp-json/wp/v2/video/{videoId}

General Arguments https://developer.wordpress.org/rest-api/reference/posts/#arguments-4


6. Delete Video

DELETE https://domain.com/wp-json/wp/v2/video/{videoId}

General Arguments https://developer.wordpress.org/rest-api/reference/posts/#delete-a-post


7. Upload Video

POST https://domain.com/wp-json/streamtube/v1/upload

Bash

Python

Javascript

PHP

Go

Last updated