Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3637

Title: Issue with PATCH Request for Updating YouTube Video Privacy Status via API

$
0
0

Title: Issue with PATCH Request for Updating YouTube Video Privacy Status via API


Context:

I am attempting to change the privacy status of a YouTube video from public to unlisted using a PATCH request.

  • Endpoint:
    https://www.googleapis.com/youtube/v3/videos?part=status
  • Method:
    PATCH
  • Authorization:
    I am using a valid Bearer token with the youtube.force-ssl scope.
  • Request Body:
    {"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted"   }}

What I Tried:

  1. Verified the Video ID:
    I confirmed that the video ID rOWGJjUUZ6Q exists by making a successful GET request to retrieve the video’s current status:

    GET https://www.googleapis.com/youtube/v3/videos?part=status&id=rOWGJjUUZ6Q
  2. Made a PATCH Request to update the video’s privacy status:

    PATCH https://www.googleapis.com/youtube/v3/videos?part=statusAuthorization: Bearer ya29.a0AcM612w9X_EA90n_64XLBguIa_HMwqKpyK9TbZAnm-ky0CaSNzVGzivkmO9Vv_NJlhJziKWLNdEMoTpx5pE8vGjrPePBJmgIFqS2blQjWJsveSjsEeP7qKb8erKHqLvLoXUUZKccLgQQnGjidjTiH1vHhJi4JsnHhe2SoIfMagaCgYKAd8SARASFQHGX2MiAKjW6kcC6NjkyoI_Inm76A0177Content-Type: application/json{"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted"  }}

What I Expected:

I expected the video’s privacy status to change from public to unlisted and receive a 200 OK response confirming the update.


What Happened:

Instead, I received a 404 Not Found response, even though the video ID is valid, the video exists, and the OAuth token has the necessary scope for modifying video status.


Minimal Reproducible Example:

  1. Request:

    PATCH https://www.googleapis.com/youtube/v3/videos?part=statusAuthorization: Bearer ya29.a0AcM612w9X_EA90n_64XLBguIa_HMwqKpyK9TbZAnm-ky0CaSNzVGzivkmO9Vv_NJlhJziKWLNdEMoTpx5pE8vGjrPePBJmgIFqS2blQjWJsveSjsEeP7qKb8erKHqLvLoXUUZKccLgQQnGjidjTiH1vHhJi4JsnHhe2SoIfMagaCgYKAd8SARASFQHGX2MiAKjW6kcC6NjkyoI_Inm76A0177Content-Type: application/json{"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted"  }}
  2. Response:

    {"error": {"code": 404,"message": "Not Found","errors": [      {"message": "Not Found","domain": "global","reason": "notFound"      }    ]  }}

Tags:

  • #YouTubeAPI
  • #PATCHRequest
  • #VideoPrivacyStatus
  • #404Error
  • #OAuthPermissions


Viewing all articles
Browse latest Browse all 3637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>