javascript - Google Plus Media-Insert - Google Domains API - 403 Forbidden -


i trying upload image google+ using javascript/jquery; have access token can use authenticate post requests following response when attempt use g+ media insert (https://developers.google.com/+/domains/api/media/insert):

{  "error": {   "errors": [    {     "domain": "global",     "reason": "forbidden",     "message": "forbidden"    }   ],   "code": 403,   "message": "forbidden"  } } 

i haven't configured domain-wide delegation because expect user sign in generate access token (is perhaps issue?). have enabled google+ domains api in developer console , relevant scopes in place can't figure out why receive 403 error. following ajax request being used:

var postform = new formdata(); postform.append("source",[code generated blob]); postform.append("displayname", "testupload");  $.ajax({     url: "https://www.googleapis.com/upload/plusdomains/v1/people/me/media/cloud",     headers: {"authorization": "bearer " + actoken},     type:"post",     uploadtype: "multipart/related",     processdata:false,     contenttype:false,     cache:false,     data: postform, }); 

any appreciated, can provide more information if needed.

ps: using userid instead of me in url moment

first, make sure userid belongs user have authenticated (perhaps through oauth flow). unlike methods such people.get, method requires authentication, , cannot called solely id, unless id authenticated user. why recommend using special value me avoid confusion.

second, need user authenticated google apps user. example, if user gmail user, request 403, since google+ domains api not allowed non-domains accounts.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -