Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access_token generated from the new API URL - https://secure.soundcloud.com/oauth/token doesn't work #343

Open
kejul-vyas-mck opened this issue Nov 11, 2024 · 4 comments

Comments

@kejul-vyas-mck
Copy link

Title: Cannot upload audio track using API

Issue found of: Nov 11th, 2024

Endpoint(s):

  • POST https://api.soundcloud.com/tracks

Scope(s):

  • None (application is not using authentication i.e., implicit flow)

Steps to reproduce:

  1. I am generating access_token using the client credential workflow - https://secure.soundcloud.com/oauth/token
  2. Access_token is generated successfully.
  3. upload the track using below curl url and Authorization header.
    curl -X 'POST'
    'https://api.soundcloud.com/tracks'
    -H 'accept: application/json; charset=utf-8'
    -H 'Content-Type: multipart/form-data'
    -F 'track[sharing]=private'
    -F 'track[asset_data]=@A-hard-row-to-hoe—whats-in-store-for-agricultural-input-suppliers-this-year.mp3;type=audio/mpeg'
    -F 'track[title]=test'
    image

Expected behaviour:

Track should be uploaded to this app - https://soundcloud.com/mckinsey

Actual behaviour:

Getting 401 Unauthorized error.

@mgoodfellow
Copy link

Hi @kejul-vyas-mck

As before: #339 (comment)

You cannot use the client credential flow to mutate data (such as POST/PUT etc) to a user context, or to view the /me endpoints. The client credential flow is an application authorization flow, it is not associated to a user.

You need to authorize a user to your app via the Authorization Code flow.

@kejul-vyas-mck
Copy link
Author

is this true? @youssefhassan if so then why I don't see anywhere here to mention that we can not use client credential workflow for POST api - https://developers.soundcloud.com/docs/api/guide#authentication

@mgoodfellow
Copy link

image

@kejul-vyas-mck
Copy link
Author

Currently with old upload track api - https://api.soundcloud.com/oauth2/token, the client credential workflow is working fine though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants