Appearance
Exchange YouTube
POST/public/account/youtube/exchangeExchange authorization code for an access token.
Endpoint Details
- Authentication: Basic Auth (
Authorization: Basic Base64(AccessKey:SecretKey)) - Access Tier: Gold+
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Authorization code received from the OAuth redirect. |
Example Request
bash
curl -X POST "https://api.repliz.com/public/account/youtube/exchange" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{}'javascript
import axios from 'axios';
const response = await axios.post('https://api.repliz.com/public/account/youtube/exchange', {}, {
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/exchange', {
method: 'POST',
headers: {
'Authorization': `Basic ${credentials}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({})
});
const data = await response.json();
console.log(data);Response
json
{
"token": "ddf88b1e4f60b62e7ab9101e6cb4df5be84f228e571bfd9a970ef03f09436bd8f3a388e8d3beebecae68225c76e2b2bc7538de3d8c529063283542d2e6bf9c0dd05bae57b1c97a987a958eb868d978756eb3ae6cb7868a9eed5f54c0f604b6ce17237adf7026558dda01e858a508aca7f809e1ceba1934982b9ae8bbbb49b868d5d40f85e6827c7f064497d81ab84ec4328b2159bf471d1c3f62206eb1a8a3442f598d381d43c2d10a5bb3ba81ced459d91e363b5133b7d26401f579cc4fb7c2fa0f862035066518b71f02ac6f8fa8893dc4eb0435a34049a908a2b293c0889fa8935b010a613efa00b081fcc11e50712863282fa547b211191a7735123fefee10bf85c739ad4088171a13240badd03594ea49f78c1cff015e63128eb27501baf543a64b29361a31ed68c2f74443166771cced518749055f83c1968572d9f881c5287cc6700bc2cd866ac5ecc7352b83a2a4317a25e58d1e6e6b6522d27f909b18a6febcbb9715b6978410eafdd81999a5c5b11cf0a451a311720bc401ed82eb.3b5091e8-fe55-4f1c-a729-86d80c152381"
}json
{
"code": 401,
"message": "unauthorized"
}