0

你好,我在这个领域新使用 api,所以请帮助我理解..如何使用这个 api 我想用 instagram 登录并获取用户照片......

        InstaConfig ic = new InstaConfig();

        ic.redirect_uri = " http://localhost";
        ic.client_secret = "******";
        ic.client_id = "*******"; 
       var user = ia.GetAccessToken(code,ic); //// what is the **Code** im geting red line  ???? asking for .. 

以及如何继续使用应用程序..我已经查看了我找不到任何帮助的每个地方...请任何人帮助如何登录并获取数据.. http://instagram.com/developer/authentication/ ....不帮助 C# 我从这个链接https://github.com/cagrik/csharp-instagram-wrapper获得帮助....

4

1 回答 1

0

在githubcodeplex上查看 InstaAPI(Instagram API 的 C# Wrapper)


登录和访问登录用户的照片:

List<Scope> scopes = new List<Scope>() { Scope.basic };
InstaConfig config = new InstaConfig("CLIENT_ID", "CLIENT_SECRET", "REDIRECT_URI", scopes);

// use this to redirect user for authenticating your application
String AuthenticationUriString = config.GetAuthenticationUriString(); 

OAuth oauth = new OAuth(config, "CODE_ATTACHED_WITH_REDIRECTEDURI_AFTERSUCCESSFUL_AUTHENTICATION");
AuthUser user = oauth.GetAuhtorisedUser();

Console.WriteLine(user.AccessToken);
Console.WriteLine(user.UserId);
Console.WriteLine(user.UserName);
Console.WriteLine(user.FullName);
Console.WriteLine(user.ProfilePicture);
于 2015-02-25T08:23:59.153 回答