Skip to content

HttpError: <HttpError 403 when requesting  #897

@ashish453

Description

@ashish453

I am trying to insert a page in blogger with draft status.
The Code I run:

import requests
from apiclient.discovery import build
Key = "My_API_Key"
BlogId = 'My_Blog_ID'

blog = build('blogger', 'v3', developerKey=Key)

body = {
        "kind": "blogger#post",
        "id": "My_Blog_ID",
        "title": "posted via python",
        "content":"<div>hello world test</div>"
        }
resp=blog.pages().insert(blogId='My_Blog_ID', body=body, isDraft=True).execute()

And I got This Error:

---------------------------------------------------------------------------
HttpError                                 Traceback (most recent call last)
<ipython-input-53-a414ec6ed6db> in <module>()
      5         "content":"<div>hello world test</div>"
      6         }
----> 7 resp=blog.pages().insert(blogId='My_Blog_id', body=body, isDraft=True).execute()

1 frames
/usr/local/lib/python3.6/dist-packages/googleapiclient/http.py in execute(self, http, num_retries)
    905             callback(resp)
    906         if resp.status >= 300:
--> 907             raise HttpError(resp, content, uri=self.uri)
    908         return self.postproc(resp, content)
    909 

HttpError: <HttpError 403 when requesting https://blogger.googleapis.com/v3/blogs/My_Blog_ID/pages?isDraft=true&key=My_API_KEY&alt=json returned "The caller does not have permission">

Metadata

Metadata

Assignees

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions