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

ChatGPT and YouTube API: OAuth Active but Unable to Access Private Channel Data

$
0
0

I created a GPT connected to the YouTube API; however, whenever I request information from my YouTube channel, it only retrieves youtube public data instead of accessing my channel-specific details, even though it is connected via Google OAuth.enter image description hereenter image description hereenter image description here

I asked help to chatgpt as I am no expert and I am circuling around the problem although I feel the solution isn't that far

{"openapi": "3.1.0","info": {"title": "YouTube Data and Analytics API Integration","description": "Fully functional API integration for YouTube Data and Analytics with Google OAuth for authentication.","version": "1.0.2"    },"servers": [        {"url": "https://www.googleapis.com","description": "YouTube Data API base URL"        }    ],"paths": {"/auth/url": {"get": {"operationId": "generateAuthUrl","summary": "Generate OAuth Authorization URL","description": "Generates the URL for the user to authenticate via Google OAuth.","parameters": [                    {"name": "client_id","in": "query","required": true,"description": "OAuth Client ID.","schema": {"type": "string","default": "ID_client_to_be_replaced" #Ireplacedit                        }                    },                    {"name": "redirect_uri","in": "query","required": true,"description": "The redirect URI after authorization.","schema": {"type": "string","default": "http://localhost/oauth2callback"                        }                    },                    {"name": "scopes","in": "query","required": true,"description": "Space-separated list of scopes for the requested permissions.","schema": {"type": "string","example": "https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/yt-analytics.readonly"                        }                    }                ],"responses": {"200": {"description": "Authorization URL generated successfully.","content": {"application/json": {"schema": {"type": "object","properties": {"auth_url": {"type": "string","description": "The generated authorization URL."                                        }                                    }                                }                            }                        }                    }                }            }        },"/auth/callback": {"post": {"operationId": "exchangeCodeForToken","summary": "Exchange Authorization Code for Token","description": "Exchanges the authorization code for an access token.","requestBody": {"content": {"application/json": {"schema": {"type": "object","properties": {"code": {"type": "string","description": "Authorization code from Google OAuth."                                    },"client_id": {"type": "string","default": "client_id" #ireplacedit                                    },"client_secret": {"type": "string","default": "client_secret" #ireplacedit                                    },"redirect_uri": {"type": "string","default": "http://localhost/oauth2callback"                                    }                                }                            }                        }                    }                },"responses": {"200": {"description": "Access token retrieved successfully.","content": {"application/json": {"schema": {"type": "object","properties": {"access_token": {"type": "string","description": "The access token to make authorized API requests."                                        },"refresh_token": {"type": "string","description": "The refresh token to renew the access token."                                        }                                    }                                }                            }                        }                    }                }            }        },"/youtube/v3/channels": {"get": {"operationId": "getChannelStatistics","summary": "Retrieve YouTube Channel Statistics","description": "Fetch channel details and statistics for a specific YouTube channel. Requires a valid OAuth token.","parameters": [                    {"name": "part","in": "query","required": true,"description": "Comma-separated list of channel resource properties to retrieve.","schema": {"type": "string","default": "snippet,statistics"                        }                    },                    {"name": "id","in": "query","required": true,"description": "The YouTube channel ID to retrieve data for.","schema": {"type": "string","example": "channel_id" #ireplacedit                        }                    }                ],"responses": {"200": {"description": "Channel statistics retrieved successfully.","content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelResponse"                                }                            }                        }                    }                }            }        },"/youtube/v3/videos": {"get": {"operationId": "getVideoAnalytics","summary": "Retrieve Analytics for Specific Videos","description": "Fetch details and statistics for specific videos by their ID. Requires a valid API key and OAuth token.","parameters": [                    {"name": "part","in": "query","required": true,"description": "Comma-separated list of video resource properties to retrieve.","schema": {"type": "string","default": "snippet,statistics"                        }                    },                    {"name": "id","in": "query","required": true,"description": "The YouTube video ID to retrieve data for.","schema": {"type": "string"                        }                    }                ],"responses": {"200": {"description": "Video data retrieved successfully.","content": {"application/json": {"schema": {"$ref": "#/components/schemas/VideoResponse"                                }                            }                        }                    }                }            }        }    },"components": {"schemas": {"ChannelResponse": {"type": "object","properties": {"id": { "type": "string", "description": "The channel ID." },"statistics": {"type": "object","properties": {"viewCount": { "type": "string" },"subscriberCount": { "type": "string" },"videoCount": { "type": "string" }                        }                    }                }            },"VideoResponse": {"type": "object","properties": {"id": { "type": "string", "description": "The video ID." },"statistics": {"type": "object","properties": {"viewCount": { "type": "string" },"likeCount": { "type": "string" },"commentCount": { "type": "string" }                        }                    }                }            }        },"securitySchemes": {"OAuth2": {"type": "oauth2","flows": {"authorizationCode": {"authorizationUrl": "https://accounts.google.com/o/oauth2/auth","tokenUrl": "https://oauth2.googleapis.com/token","scopes": {"https://www.googleapis.com/auth/youtube.readonly": "Read YouTube data.","https://www.googleapis.com/auth/yt-analytics.readonly": "Read YouTube Analytics data."                        }                    }                }            }        }    }}

Viewing all articles
Browse latest Browse all 3831

Trending Articles



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