Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
Using SC.Get() from the JS library since the OAuth token in header update

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) {})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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
})
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!