Since the SC Dev's OAuth Tokens from URL to Header update i can't get the SC.Get() function of the javascript SDK to work, as it appears to pass the OAuth token in the URL rather than a header resulting in a 401 error.
Is this to be expected or am I missing something? Is it possible to set the header through the properties?
I am using this version of the sdk: https://connect.soundcloud.com/sdk/sdk-3.3.2.js
here is the Get code I am using
var route='/me/activities'
var properties = {
limit: 50
};
SC.get(route, properties, function(data) {})
This is what I'm using instead of SC.Get() now
function getStuff(route,callback){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var data=JSON.parse(this.responseText)
console.dir(data)
callback(data)
}
};
xhttp.open("GET", "https://api.soundcloud.com"+route+"?limit=200&linked_partitioning=true", true);
xhttp.setRequestHeader("accept", "application/json; charset=utf-8");
xhttp.setRequestHeader("Authorization", "OAuth "+getCookie("SCaccess"));
xhttp.send();
}
Calling it like this
getStuff(route, function (data) {
//do stuff with data
})