I have spent the last several days implementing OAuth-based communication with Yahoo! in order to retrieve a user's contact information and I have successfully built an implementation which works beautifully with a Yahoo! account I created several years ago.
Now I am attempting to retrieve the contacts for a user I just barely created and Yahoo! is returning an incredibly informative 503 (Service unavailable) error to the tune of:
<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://social.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:uri="http://www.yahooapis.com/v1/errors/503" yahoo:lang="en-US">
<description>Not available</description>
<detail>new user</detail>
</error>
Currently, I am using the older version of the Contacts API which is queried with a request to: http://social.yahooapis.com/v1/user/{guid}/contacts?format=XML, so in an effort to track the issue I tested a query to the new YQL based mechanism in the YQL Console and was able to retrieve contacts for the user in question. I attempted to switch my application to use YQL, but for some reason, reusing the OAuth authorization process I had in place for the old API is resulting in a 401 (Unauthorized) error when I request http://query.yahooapis.com/v1/yql?format=xml&q=select%20*%20from%20social.contacts%20where%20guid={guid} (or guid=me):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<yahoo:error xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:uri="http://yahoo.com" xml:lang="en-US">
<yahoo:description>Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_SIGNATURE_INVALID_ERROR", realm="yahooapis.com"</yahoo:description>
<yahoo:detail>Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_SIGNATURE_INVALID_ERROR", realm="yahooapis.com"</yahoo:detail>
</yahoo:error>
So, I have two questions and I'd be happy with an answer to either one:
Why can't I get contacts from the Yahoo! old Contacts API for new Yahoo! accounts
(OR) Why is my YQL query for contacts returning a 401 error?
Update
I did some further testing with the original Contacts API and it seems that Yahoo! is blocking the retrieval of contacts for users which were created recently. Although I am not sure what Yahoo! considers 'recent', I was able to retrieve contacts for a user created a little over 2 weeks ago. Why isn't this in their documentation? :(
Related
I am querying to get a single message from the Microsoft graph API like the following:
https://graph.microsoft.com/v1.0/users/<name>/messages/<id>
However, i am getting a response that is just an empty string. If i make the same request using the beta version of the api like the following:
https://graph.microsoft.com/beta/users/<name>/messages/<id>
The email in question is a calendar share invitation of content-type of "application/ms-tnef" and content-class of "Sharing" in the email headers.
I can't find any documentation indicating this is a known issue in the system. Is there any way to get this to work in the graph API or is the only work-around is to use the beta version instead?
Using Graph Explorer, and recreating your request using their demo accounts returns a result in v1.0. I assumed by name you meant the user's email address and I made the same request using the Guid id of the user.
https://graph.microsoft.com/v1.0/users/MeganB#M365x214355.onmicrosoft.com/messages/AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAHi4GJzAAA=
https://graph.microsoft.com/v1.0/users/48d31887-5fad-4d73-a9f5-3c356e68a038/messages/AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAIgOnGGAAA=
Have you attempted the same request using graph explorer?
I've been using for many years my FACEBOOK_APP_ID|FACEBOOK_APP_SECRET as an app access token for accessing the facebook API, but lately it seems to be giving me not up to date data.
For example, on this page:
https://www.facebook.com/pg/Vallagruppen/posts
If I just view in the graph explorer with the default access tokens, I get the correct results:
https://developers.facebook.com/tools/explorer/?method=GET&path=Vallagruppen%2Fposts&version=v2.11
But if I change the access token in the explorer to one like above, with an APP_ID|APP_SECRET I am suddenly not getting all the posts, the newest few are not showing up.
Additionally it will say: "Access Token Info Warning Failed to debug token"
Any idea why?
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 am trying to implement oauth2 for yahoo (target is yahoo's contact api). See here: https://developer.yahoo.com/oauth2/guide/#implicit-grant-flow-for-client-side-apps
However, I get the following error:
Oops. Yahoo is unable to process your request.
We recommend that you contact the owner of the application or web site to resolve this issue. [95037]
How to get this resolved? It comes with I use response_type=token (which is needed for Implicit Grant Flow), but works fine for response_type=code
[EDIT]
The request to yahoo (urldecoded):
https://api.login.yahoo.com/oauth2/request_auth?client_id=[CLIENT_ID]&response_type=token&redirect_uri=[PATH]&display=popup&scope=&state={"client_id":"[CLIENT_ID]","network":"yahoo","display":"popup","callback":"_hellojs_23g8z6wk","state":"","redirect_uri":"[PATH]","scope":"friends,basic"}
[UPDATE]
After following the recommendations from HansZ., I was able to resolve it.
Now the issue has come back without changing any code. Basically, it only works when I am logged in with the Yahoo ID that I used to setup the App at Yahoo.
Otherwise, sometimes it goes in loops and chrome says
This webpage has a redirect loop`
rest of the time it gives the error again.
Your state is the problem. I can reproduce the problem by including your URL-encoded state in the authorization request for my Yahoo client. The problem is the length of the state or the total URL. You may revert to using a cookie for maintaining that state and send only the (much shorter) cookie name as the state parameter.
We recently updated the SDK to v3.14.By default, were requesting the users for the following permissions: #"user_birthday",#"user_friends",#"public_profile",#"email",#"friends_birthday"
and use the query #"https://graph.facebook.com/me/friends?fields=id,birthday,name,picture&access_token=.."
We've noticed that birthday information is missing for some of users. The behavior is inconsistent.
For example:for one of our users, only 30 out 600 friends are returned in the JSON request.. I believe it not reasonable all the others revoked their permissions..
In another case, all friends were returned, but most returned without the birthday field - see two entries from the same response:
no birthday:
{"id":"616933360","name":"XXX XXXX","picture":{"data":{"url":"https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash3/t1.0-1/c40.0.100.100/s50x50/1098171_10151793243593361_626621565_a.jpg","is_silhouette":false}}}
with birthday:
{"id":"590531323","birthday":"05/31/1983","name":"XXX XXX","picture":{"data":{"url":"https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash3/t1.0-1/c0.8.50.50/p50x50/1660299_10151840501221324_512792944_t.jpg","is_silhouette":false}}}
I've tried the Graph Api Explorer tool and saw similar results. The token debugger also shows that the token is valid.
Does anyone else experience this behavior? Is this a bug in facebook API?