vb.net - Execution of request failed - Upload photo picasa Album API vbnet -
dim p_service google.gdata.client.service = new google.gdata.photos.picasaservice("auth_test_app") dim p_parameters new google.gdata.client.oauth2parameters() dim p_application_name string = "test_app" 'step 1 - configure how use oauth 2.0 dim client_id string = "xxxxxxx.apps.googleusercontent.com" dim client_secret string = "xxxxxx" dim scope string = "http://picasaweb.google.com/data/" dim redirect_uri string = "xxxxx:2.0:oob" 'step 2 - set oauth 2.0 object p_parameters.clientid = client_id p_parameters.clientsecret = client_secret p_parameters.redirecturi = redirect_uri p_parameters.scope = scope 'step 3 - authorization url dim authorizationurl string = google.gdata.client.oauthutil.createoauth2authorizationurl(p_parameters) 'i have access token :) process.start(authorizationurl) p_parameters.accesstoken = "xxx" dim requestfactory new google.gdata.client.goauth2requestfactory(nothing, p_application_name, p_parameters) p_service.requestfactory = requestfactory 'once set dont need oauth until expires 'error here!!!!!!!!! dim user_id ="104929871952334xxxxx" dim album_id ="60664808827372xxxxx" dim posturi new uri(picasaquery.createpicasauri(user_id, album_id)) 'my image url :) dim fileinfo new system.io.fileinfo("c:\users\1.jpg") dim filestream system.io.filestream = fileinfo.openread() 'now error dim request = p_service.insert(posturi, filestream, "image/bmp", "name image.")
execute program.
execution of request failed: https://picasaweb.google.com/data/feed/api/user/104929871952334xxxxx/albumid/60664808827372xxxxx
i have error, dont upload image piccasa.
i think miss permission app: "https://picasaweb.google.com/data/ code:
string[] scopes = new string[] {"https://picasaweb.google.com/data/", oauth2service.scope.userinfoemail };
Comments
Post a Comment