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

88
Views
How to add uris to post request in javascript

I can't seem to figure out how to add uris to a post request like in this api request: https://developer.spotify.com/console/post-playlist-tracks/?playlist_id=3cEYpjA9oz9GiPac4AsH4n&position=&uris=spotify%3Atrack%3A4iV5W9uYEdYUVa79Axb7Rh%2Cspotify%3Atrack%3A1301WleyT98MSxVHPZCA6M

this is what my request looks like currently put does not work

fetch(endPoint, {
method: "POST",
headers: {
  Authorization: `Bearer ${access_token}`,
},
body: JSON.stringify({
  "uri": data
})
});

thanks in advance for any help

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Based on this doc: https://developer.spotify.com/documentation/web-api/reference/#/operations/add-tracks-to-playlist

It looks like you have the format of the body wrong. It should look something like this:

    fetch(endPoint, {
        method: "POST",
        headers: {
            Authorization: `Bearer ${access_token}`,
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            uris: [
                "uri-1",
                "uri-2",
            ],
        })
    });
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!