Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

242
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda