APIs & Integrations

khp
Member

No longer able to create blog posts with API

Hi,
using the COS blog posts API I could create blog posts till last week.
From then on we only got the HTTP code 403 with the error message CONTENT_SCOPE_RESTRICTED back.

I checked the access token and it has nearly all available scopes (including files and content).

What’s confusing is the endpoint is located at /content/api/v2/blog-posts but the error message mentions /blogs/v3/blog-posts as request url.

If I try /blogs/v3/blog-posts as endpoint I get another error message (PARENT_BLOG_DOES_NOT_EXIST)

The only thing changed was our blog domain. I tried a new domain for blog posts, but deleted that domain after some time.

TIA
KHP

14 Replies 14
ChadP
Contributor | Elite Partner
Contributor | Elite Partner

No longer able to create blog posts with API

I am getting a similar error when transferring blog posts from one blog to another using hapikey

I can perform the get to retreve the post from one blog but when I try to post the article to the new blog it gives me a 500 error

<title>Error 500 Server Error&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;&lt;h2&gt;HTTP ERROR 500&lt;\/h2&gt;\n&lt;p&gt;Problem accessing \/blogs\/v3\/blog-posts. Reason:\n&lt;pre&gt;    Server Error&lt;\/pre&gt;&lt;\/p&gt;&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n&lt;br\/&gt;                                                \n\n&lt;\/body&gt;\n&lt;\/html&gt;\n"&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;</title>

Sorry that it is so long but they is the error i am getting back from hubspot

Any ideas?

0 Upvotes
Not applicable

No longer able to create blog posts with API

Hi all. Just be sure to set the Content-Type header in your POST calls to “application/json” if you are passing JSON. Magic!

Not applicable

No longer able to create blog posts with API

Just checked, I’m able to POST to blog-posts again (with OAuth).

0 Upvotes
khp
Member

No longer able to create blog posts with API

Using hapikey was the only possibility for us to create and publish blog posts again

0 Upvotes
Not applicable

No longer able to create blog posts with API

I’m experiencing the same issue (using oAuth). When making a POST request, I receive the following response:

Headers:

HTTP/1.1 403 Forbidden
Access-Control-Allow-Credentials: false
Content-Type: application/json; charset=UTF-8
Content-Length: 337

Body:

{
  "correlationId": "xxxx",
  "errorTokens": {
    "action": [
      "create"
    ],
    "contentId": [
      "xxxx"
    ],
    "contentType": [
      "blog post"
    ]
  },
  "errorType": "CONTENT_SCOPE_RESTRICTED",
  "message": "User does not have permission to create the blog post with id xxx. ",
  "requestId": "xxxx",
  "status": "error"
}
0 Upvotes
Sergey
Member

No longer able to create blog posts with API

Same issue here, we can only create pots if we use hapikey, but no way of doing it via tokens, we get the same errors.

0 Upvotes
khp
Member

No longer able to create blog posts with API

So hapikey still works? Could be a workaround. But I thought hapikey is deprecated.

0 Upvotes
Sergey
Member

No longer able to create blog posts with API

Yes, we are able to do it via the hapikey. Not so much deprecated, but isn’t an optimal solution, as only professional and enterprise users have access to hapikey. Email API for instance also seems to only support the hapikey and not oAuth. I mean, the Email API for creating an email, not the one listed in the help docs.

0 Upvotes
khp
Member

No longer able to create blog posts with API

We could use hapikey (professional license) but I would like to use Oauth for all; especially since it worked in the past

0 Upvotes
Sergey
Member

No longer able to create blog posts with API

Definitely. They have the Oauth for a reason after all. Guess we just need to wait for someone from Hubspot to come by :slight_smile:

0 Upvotes
RhiannonKingdom
Member

No longer able to create blog posts with API

I have been using the hapikey and still not able to create posts. What headers are you including in your request?

0 Upvotes
khp
Member

No longer able to create blog posts with API

Using the hapikey I can create blogs posts again.
I send no special headers. Do you get an error?

0 Upvotes
RhiannonKingdom
Member

No longer able to create blog posts with API

I don’t get an error. I get a response 200, the following header and no response body
{'Date': 'Wed, 22 Mar 2017 21:57:35 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'false'}
At this stage all I am sending is this JSON
{ "name": "My first API blog post","content_group_id": 4308079277 }
to this URL: https://api.hubapi.com/content/api/v2/blog-posts?hapikey=xxx-xx-xx-xx

0 Upvotes
RhiannonKingdom
Member

No longer able to create blog posts with API

I am having a similar problem. On March the 16th my python script stopped working. It had been working for months. I am posting to https://api.hubapi.com/content/api/v2/blog-posts?hapikey=XXXXXXXXXXX and getting the following response:
status code: 200
response body: ‘’

I am unsure what has caused this change! normally a successful post responds with 201

0 Upvotes