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

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

$
0
0

I’m encountering an issue when trying to update the privacy status of a YouTube video using the YouTube Data API v3.

Context:I’m using a PATCH request to change the privacy status of a video from public to unlisted.The endpoint I’m using is:bashCopy codehttps://www.googleapis.com/youtube/v3/videos?part=statusThe body of my request is:jsonCopy code{"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted"}}I have correctly set the Authorization header with a Bearer token that includes the youtube.force-ssl scope.Problem:Despite sending the request with the correct video ID and body, I receive a 404 Not Found response. I have verified that:

The video ID is correct and the video exists on my account.The OAuth token is valid and contains the correct scopes.I have confirmed the video details using a GET request, and the video is currently public.Is there something I’m missing, or are there any additional permissions or settings I need to check in order to successfully change the privacy status?

Thank you for your help!

What I Tried:

Verified the Video ID:

I confirmed that the video ID rOWGJjUUZ6Q exists and is associated with my account by making a successful GET request to retrieve the video’s status using the endpoint:bashCopy codehttps://www.googleapis.com/youtube/v3/videos?part=status&id=rOWGJjUUZ6QPATCH Request to Update Privacy Status:

I made a PATCH request to the following endpoint:bashCopy codehttps://www.googleapis.com/youtube/v3/videos?part=statusThe request body was structured as follows to change the privacy status to unlisted:jsonCopy code{"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted"}}I used a valid Bearer token with the required youtube.force-ssl scope in the Authorization header.Expected Outcome:

I expected the video’s privacy status to update from public to unlisted and receive a 200 OK response, indicating the status was successfully updated.Actual Outcome:

Instead, I received a 404 Not Found error, despite the video ID being valid and the video existing on my account.Is there a reason why the PATCH request might return a 404 error even though the video is confirmed to exist and the OAuth token includes the necessary scopes?


Viewing all articles
Browse latest Browse all 3638

Trending Articles



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