Getting 403 Client error: Forbidden when trying to delete/update sets using python SoundCloud API -
i'm developing python app managing playlists(sets). app needs create/update/delete sets using soundcloud api.
it's ok create set using api. when i'm trying modify or delete created playlists, im getting 403 client error: forbidden.
i used "authenticating without soundcloud connect screen" section api docs.
here code:
client = soundcloud.client(client_id='my_id', client_secret='my_secret', username='name', password='pass') client.post('/playlists', playlist={'title': 'test playlist', 'sharing': 'public', 'tracks': [], 'permalink': 'test-playlist'}) client.delete('/playlists/test-playlist')
and im getting following exception on delete:
traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/local/lib/python2.7/dist-packages/soundcloud/client.py", line 130, in _request return wrapped_resource(make_request(method, url, kwargs)) file "/usr/local/lib/python2.7/dist-packages/soundcloud/request.py", line 190, in make_request result.raise_for_status() file "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 683, in raise_for_status raise httperror(http_error_msg, response=self) requests.exceptions.httperror: 403 client error: forbidden
also im getting same exceptions whet trying add tracks playlist
client.put('/playlists/test-playlist', playlist={'tracks': tracks})
where tracks is:
[{'id': 57417403}, {'id': 100249929}, {'id': 37964083}]
Comments
Post a Comment