Appearance
Connect YouTube
POST/public/account/youtube/connectLink a selected YouTube channel to your workspace using its channel ID and access token.
Endpoint Details
- Authentication: Basic Auth (
Authorization: Basic Base64(AccessKey:SecretKey)) - Access Tier: Gold+
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
channelId | string | Yes | The unique identifier of the YouTube Channel to connect. |
token | string | Yes | Access token received from the exchange step. |
Example Request
bash
curl -X POST "https://api.repliz.com/public/account/youtube/connect" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{"channelId":"UCxxxxxxxxxxxxxx","token":"ACCESS_TOKEN"}'javascript
import axios from 'axios';
const response = await axios.post(
'https://api.repliz.com/public/account/youtube/connect',
{
channelId: 'UCxxxxxxxxxxxxxx',
token: 'ACCESS_TOKEN',
},
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.data);javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch(
'https://api.repliz.com/public/account/youtube/connect',
{
method: 'POST',
headers: {
Authorization: `Basic ${credentials}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
channelId: 'UCxxxxxxxxxxxxxx',
token: 'ACCESS_TOKEN',
}),
},
);
const data = await response.json();
console.log(data);Response
json
{
"accountId": "69e97477a795504e0786cec6"
}json
{
"code": 401,
"message": "unauthorized"
}