My ID: 9829193
Jacob's Song ID: 994537984
const appVersion = 1618476442;
const appLocale = 'en';
const authToken = ''
const clientId = '';
const likeSongEndpointTemplate = [
'https://api-v2.soundcloud.com',
'/users/{{userId}}/track_likes/{{trackId}}',
'?client_id={{clientId}}&app_version=1618476442&app_locale=en'
].join('');
const currentlySignedInUserId = 9829193;
const djMilamTrackId = 994537984;
const endpoint = likeSongEndpointTemplate
.replace('{{userId}}', currentlySignedInUserId)
.replace('{{trackId}}', djMilamTrackId)
.replace('{{clientId}}', clientId);
fetch(endpoint, {
data: {
'app_locale': appLocale,
'app_version': appVersion,
clientId
},
headers: {
'Authorization': `OAuth ${authToken}`,
'Content-Type': 'application/json'
},
method: 'PUT',
})
.then(res => res.json())
.then(res => console.log({ res }))
.catch(err => console.error({ err }));