Right way to get access token Web API

7 views
Skip to first unread message

Joshua Weikert

unread,
Aug 13, 2016, 8:28:51 AM8/13/16
to Rhapsody API
Hi,

I'm stuck with the oauth process and I wanted to ask you whats the right way to call for an access token.
This is the code im using right now:

let codeFromUrl = code=YzFmNjFmNGYdODY1YSD00NhkLTgxZWMtYjU0MnVlMzg5MTRh


let url = NSURL(string: "https://api.napster.com/oauth/access_token?" + "client_id=*censored*&client_secret=*censored*&response_type=code&grant_type=authorization_code&redirect_uri=*censored*&" + codeFromUrl)

                

                NSURLSession.sharedSession().dataTaskWithURL(url!) { (data, response, error) in

                    

                    if error != nil

                    {

                        print(error)

                        return

                    }

                    

                    let info = NSString(data: data!, encoding: NSUTF8StringEncoding)

                    print(info)



*censored*  means that i censored this btw ^^" 


greets Josh

Reply all
Reply to author
Forward
0 new messages