Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8423131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:38:41+00:00 2026-06-10T03:38:41+00:00

Test whit php-soundcloud I try to use the script php-soundcloud (Oauth 2) and I

  • 0

Test whit php-soundcloud

I try to use the script php-soundcloud (Oauth 2) and I encounter a problem after user login.
I do exactly the tutorial wiki: https://github.com/mptre/php-soundcloud/wiki/Oauth-2

When the user has accepted the application, it returns the following URL: http://mywebsite.com/?code=123456789123456789

I get the correct $_GET['code'] but the function accessToken() will not retrieve the information, it gives me a HTTP code 401 error (see the picture below).

HTTP code 401 soundcloud

Here is my code (the most basic):

<?php

include 'Services/Soundcloud.php';
$soundcloud = new Services_Soundcloud('_myClientId_', '_ClientSecret_', '_RedirectUri_');

echo '<a href="' . $soundcloud->getAuthorizeUrl() . '">Connect with SoundCloud</a><br />';

try {
    $accessToken = $soundcloud2->accessToken($_GET['code']);
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
    exit($e->getMessage());
}

Here is HTTP Status Codes of soundcloud: http://developers.soundcloud.com/docs/api/guide#errors
They say that the code 401 is: Make sure you’re sending us a client_id or access_token.
But I’m sure to send the correct id and token! :/

If someone has already manipulate SoundCloud API and know why I get this error, let me know of any solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:38:42+00:00Added an answer on June 10, 2026 at 3:38 am

    ok, i have find! it’s so easy…
    I had not seen the function setAccessToken() which adds the token to the class

    try {
        $accessToken = $soundcloud2->accessToken($_GET['code']);
        // this is the part that I was missing
        $soundcloud2->setAccessToken($accessToken["access_token"]);
    } catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
        exit($e->getMessage());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

test.php?t=xxx,y=sss This is how the user inputs data to my script. How can I
Page1 : test.php (open in popup) <script type=text/javascript> function addFiles(aFiles) { if ($('#addfiles').length==0) $('#addfiles').html;
test login logout user is not online do get :login, :id=>1 before = User.find(1).is_online
Test script use JSON; $\ = \n; my $big_number = '12345678901234567890123456'; print $big_number; print
I test password recovery, but there are errors. Rspec study recently. code (User Controller)
i have a problem to fix that url rewriting code RewriteRule ^([aA-zZ0-9_-]+)/?([0-9]*)/?([A-Za-z0-9_-]*)/?([A-Za-z0-9_-]*)/?$ index.php?m=$1&r=$2&a=$3&b=$4 [QSA]
test.html: <html> <head> <script type=text/javascript src=jquery-1.4.2.js></script> <script type=text/javascript src=test.js></script> </head> <body> <input id=but2 type=button
test.php - Using regular IDE(phpDesigner7) <head> <meta http-equiv=content-type content=text/html; charset=iso-8859-1 /> </head> <body> <?php
I use SfDoctrine guard in my test project. I use also SfForkedApply for registration
Test site: http://wfwgm.stage.philosophydesign.com/ I have included: <script src=http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js></script> to give :before support in IE6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.