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

233
Views
Usando SC.Get () de la biblioteca JS desde el token OAuth en la actualización del encabezado

Dado que los tokens OAuth de SC Dev de URL a encabezado se actualizan, no puedo hacer que funcione la función SC.Get() del SDK de javascript, ya que parece pasar el token OAuth en la URL en lugar de un encabezado que genera un error 401 .

¿Es esto de esperar o me estoy perdiendo algo? ¿Es posible establecer el encabezado a través de las propiedades?

Estoy usando esta versión del SDK: https://connect.soundcloud.com/sdk/sdk-3.3.2.js

aquí está el código Get que estoy usando

 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

Esto es lo que estoy usando en lugar de SC.Get() ahora

 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(); }

llamándolo así

 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!