I am using I am not sure whether I am using a I get Whoops, sorry, I did not fix it for the first time I am using, I work a bit differently in my code because I constantly refresh. In any case, it is a reasonable argument: FII, against your code Auth Token parameter I can send.
string _token = _google.Token; RequestSettings Request Settings = New Request Settings ("AppName", _Token); Confirm contactsRequest contacts = new contact request (request settings); // Get Feed Feeds & lt; Contacts & gt; Feed = contactsRequest.GetContacts (); 401 unauthorized as a response to this code, but if I send a username and password as a parameter, then a response to me Can be found.
// your app var parameter = new OAuth2Parameters {ClientId = @ "", ClientSecret = @ "", RedirectUri = @ "", Scope = Get this info from Google's API console after signing up for "https://www.google" .com / m8 / feeds / ",}; // Authorization URL string url = OAuthUtil.CreateOAuth2AuthorizationUrl (parameter) generated; // Now use the URL to authorize the app in the browser and get the access code (...) // Get this information from Google's API Console after entering your app parameters. Accesscode = @ "Get a Access Token OAuthUtil.GetAccessToken (Parameter) from the previous step; // Connection Setup Service Contacts for Contact Services = New Contact Request (New Request Settings (" & lt; appname & gt; ;;, Parameter)); // Contact each contact (contact in contact contact. Login).} GetAccessToken () After calling and refresh token in your parameter data structure field If you store these two values, you can set them in the parameter configuration in the later call (allowing you to skip asking for authorization in the future) and GetAccessToken () Instead of calling, simply RefreshAccessToken and you will always have access to the right thing? Your app var parameter = new OAuth2Parameters {ClientId = @ "", ClientId = @ "" , RedirectUri = @ After registration, this information from Google's API console Make:
"", scope = @ "https://www.google.com/m8/feeds/", AccessCode = "", AccessToken = "", / * old call GetAccessToken here * / RefreshToken = "", / * Get value from the old call using GetAccessToken here * /}; // Get an access token OAuthUtil.RefreshAccessToken (parameter); // Connection Setup Service for Contact Services Contacts = New Contact Request (New Request Settings ("& lt; appname & gt;", Parameter)); // Contact each contact (contact please contact. } Edit : // Now use the URL to authorize the app in the browser and get the access code (...) // your app var parameter = new Oath2 parameter {ClientId = @ "", ClientSecret = @ "", Redirect URI = @ "", Scope = @ "https://www.google.com/m8/feeds/", from the previous step & gt; AccessCode = @ "& lt ;;;}; // Get an OAuthUtil.GetAccessToken (parameter) Access Task Connection Setup Service for contacts service service contacts = new contact request (new request settings (" & lt; appname & Gt; ", parameter)) // Contact each contact (contact please contact. Login).}
Comments
Post a Comment