I was trying to get the tracks under "Discover Weekly", But it says unauthorized access.
RestClient::Unauthorized: 401 Unauthorized from /home/<user>/.rvm/gems/ruby-2.1.1#<project>/gems/rest_client-1.8.2/lib/restclient/abstract_response.rb:48:in `return!'
In the playlist i am getting "Discover weekly" but when I try to search tracks for it, its causing this error.
Any help would be great!!
The issue here is that the Discover Weekly list is private by default. Trying to access a private playlist with the gem will throw a 401. By making the playlist public and using spotifydiscover as the username, you can access the playlist via the API. For example:
RSpotify::Playlist.find('spotifydiscover', '4ri0zgl8aDgNv2zoVPbUFZ')
Related
I am trying to call following Twitter's API to get a list of followers for a user.
http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username
And I am getting this error message in response.
{
code = 215;
message = "Bad Authentication data";
}
I can't seem to find the documentation related to this error code. Anyone has any idea about this error?
Your request lacks authentication data. I got that error when I simply clicked on http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username. This is not the way to access twitter API.
Create a Twitter app from https://apps.twitter.com/. Then, try using a Twitter API Library to access REST API. If you are comfortable with using ruby apps on command line interface check out https://github.com/sferik/t. Set it up and then try t followers [USER] for listing all followers of USER.
You will have to use OAuth. More info can be found on Twitter website. Here: https://dev.twitter.com/oauth
This error is coming because your Twitter developers account is not approved. Now-a-days you can't make app without getting your developers account approved from Twitter.
To make an app, you need to contact Twitter and apply for developers account. If you are lucky engough, you will get approval although this process may take months.
If you just need the data, go for third party services like followersanalysis[dot]com, birdsonganalytics[dot]com
I'd like to get the impressionBasedCpm from the Api Explorer ( and later from my app).
I can log in with an youtube partner account and toggle the oauth switch. I set all scopes to checked.
Then I try to enter
ids: contentOwner==NAME_OF_CONTENT_OWNER (not the id, retrieved from the content API, https://developers.google.com/youtube/partner/docs/v1/contentOwners/list#try-it)
metrics: impressionBasedCpm
start-date: '2015-05-01'
end-date: '2015-06-01'
The output still tells me:
You do not have permission to execute this method.
Can someone help me?
My guess is that when I authorize the application I seam to still login as a channel, so the query as a content owner is not allowed. I picked the main one with the email address. But when I'm on youtube I can switch to a specific Content-Manager Channel/Account.
Even when I try to just get the 'likes' for the contentOwner it doesn't work. If I try to get the likes based on the channel_id it works. But I like to get reports for a youtube partner that uses youtube's cms.
cheers
This query won't work because it does not follow the semantics of the API. You need to provide the ID of the contentOwner in order to get a 200 OK response. Name of Content Owner cannot be unique and hence would lead to erroneous results.
I am unable to fetch the processingDetails,fileDetails,suggestions information from the youtube api call. I had used API key to fetch these details but it's not working
First I tried this API Call mentioned below, It's working
https://www.googleapis.com/youtube/v3/videos?id=Skk6MBoejgU&key={API_KEY}&part=snippet,statistics,contentDetails,player
When I tried to fetch processingDetails,fileDetails,suggestions information, It's throwing error message
https://www.googleapis.com/youtube/v3/videos?id=Skk6MBoejgU&key={API_KEY}&part=processingDetails,fileDetails,suggestions
Error message: forbidden
Can anyone help me to solve this issue ?
Because you need to be connected with your YouTube Channel to get this informations.
In fact, this is private informations, you can only get this informations only from your videos.
We can find this information in the doc of YouTube API V3
forbidden (403) forbidden
The request cannot access user rating information. This error may
occur because the request is not properly authorized to use the
myRating parameter.
I am trying to use the Youtube data API from an app, and I'd like to just request permission to upload videos, not to manage their entire Youtube account.
When I try to request an access token for the scope https://www.googleapis.com/auth/youtube.upload, I get back an error saying it is an invalid scope. I've given the app permission to the Youtube v3 data API.
According to the v3 youtube docs, these are the supported scopes:
https://www.googleapis.com/auth/youtube - Manage your YouTube account.
https://www.googleapis.com/auth/youtube.readonly - View your YouTube account.
https://www.googleapis.com/auth/youtube.upload - Upload YouTube videos and manage your YouTube videos.
The only one of these 3 that works for me is "https://www.googleapis.com/auth/youtube".
This is the request I am attempting:
curl -d "client_id=id&scope=https://www.googleapis.com/auth/youtube.upload" https://accounts.google.com/o/oauth2/device/code
And this is the response:
{
"error" : "invalid_scope",
"error_description" : "Not authorized to request the scopes: [https://www.googleapis.com/auth/youtube.upload]",
"error_uri" : "http://code.google.com/apis/accounts/docs/OAuth2.html"
}
I am thinking that maybe this type of request just doesn't work for device codes? The youtube.upload scope request seems to work fine in the oauth2 playground.
Update: This issue has been fixed.
This scope by itself was not whitelisted for the devices. Filed a request internally.
On the other hand, as explained here, Stackoverflow is for programming questions, you can use public issue tracker for bug reports or feature requests.
Feel free to file a bug report in issue tracker to get updated on this issue.
I'm using eventbrite.com, and I'm trying use the rest API to get all the previous events for my user (organizer in eventbrite). I am expecting to get events that have occurred in the past.
I'm using the following url:
https://www.eventbrite.com/xml/event_search?organizer={MyOrganizerName}&app_key={MyAppKey}&date=past
However, I get nothing returned. ever. I am sure that have some events that happened in the past.
I am successfully getting events in the future. so there's nothing wrong with my client\app key\spelling\whatever.
With the newer Eventbrite APIv3 the endpoint changed to /users/me/owned_events The API comes with an API Explorer, which lets you see detailed debugging information for any endpoint just by going to it in a web browser.
Paste this url with your token id into your browser to get all past events:
https://www.eventbriteapi.com/v3/users/me/owned_events/?token=YOURTOKENID
The result is a paginated response of all the events your user account is organizing.
The event_search method is meant to return publicly available information about upcoming events only.
Try user_list_events instead:
https://www.eventbrite.com/xml/user_list_events?app_key={YOUR_APP_KEY}&user_key={YOUR_USER_KEY}&event_statuses=ended
You also have the option of creating an Organizer Profile Page, allowing you to group similar events together. The organizer_list_events API call may be useful for folks who are using that feature.