APIs & Integrations

JoeHu
Membro

No longer able to create website pages via API

resolver

Our app helps users to create pages in HubSpot portal, it had been working fine until one or two weeks ago, since then it fails when calling POST /content/api/v2/pages with following error:

 

{"correlationId":"816b5c7b-58e3-4a6f-b051-973b07b1cbd7","errorTokens":{"action":["create"],"contentId":["10993330975"],"contentType":["site page"]},"errorType":"CONTENT_SCOPE_RESTRICTED","message":"User does not have permission to create the site page with id 10993330975.","requestId":"47a022b1-a6d2-4fda-b6b9-834997c00a8d","status":"error"}

 

Note that this only happens with site pages, the app can create landing page without error. I tested a few portals and all of them fails with the same error. Can you help us to fix it? Thank you.

0 Avaliação positiva
1 Solução aceita
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

No longer able to create website pages via API

resolver

Hey, @JoeHu.

 

Apologies for the delayed response. I've just sent you a direct message.

Isaac Takushi

Associate Certification Manager

Exibir solução no post original

0 Avaliação positiva
14 Respostas 14
himanshurauthan
Autoridade no assunto | Parceiro Elite
Autoridade no assunto | Parceiro Elite

No longer able to create website pages via API

resolver

Hello @JoeHu 

Can you please tell how you are making API call like either with OAuth2.0 or API key. Its a user permission error for a API call. If you are using the oauth for the APP then make sure it is authorized either with the super admin user or respective user role who has the permission to create pages on HubSpot. It may be a case that the APP do not fulfills all the scopes while authorization by a user.

Thankyou.

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Avaliação positiva
JoeHu
Membro

No longer able to create website pages via API

resolver

Hi @himanshurauthan , thank you for your reply. My app uses OAuth and it requests following scopes: `content contacts forms`. Even if I authorizes with Super Admin user, I still can't create site page (although I can create landing page as mentioned). Any idea?

0 Avaliação positiva
himanshurauthan
Autoridade no assunto | Parceiro Elite
Autoridade no assunto | Parceiro Elite

No longer able to create website pages via API

resolver

@JoeHu 

can you make sure that the account has Marketing professional or Enterprise plan activated? Because the content scope is allowed on only such plans.


Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Avaliação positiva
JoeHu
Membro

No longer able to create website pages via API

resolver

@himanshurauthan 

 

Yes I can confirm that. And the app is working for the same portal a few weeks ago.

0 Avaliação positiva
himanshurauthan
Autoridade no assunto | Parceiro Elite
Autoridade no assunto | Parceiro Elite

No longer able to create website pages via API

resolver

@JoeHu 
Can you please mention the request API code that you are sending for creating new pages? May be I can find something from that?

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Avaliação positiva
JoeHu
Membro

No longer able to create website pages via API

resolver

@himanshurauthanMy code is a bit too complex to put here, but I can provide sample of body of a failed request:

 

{
    "enable_layout_stylesheets":true,
    "name":"My new landing page",
    "include_default_custom_css":false,
    "enable_domain_stylesheets":false,
    "template_path":"generated_layouts/5458378816.html",
    "widget_containers":{
        "body_flexible_column":{
            "widgets":[
                {
                    "body":{"module_id":2755238,"widget_name":"SUF - Feature 2 \u2705"},
                    "name":"widget_05940e4a273a42afb4c3d483ea46af82",
                    "label":"SUF - Feature 2 ",
                    "module_id":"2755238",
                    "type":"module",
                    "order":"0"
                }
            ]
        }
    },
    "subcategory":"site_page"
}

 

0 Avaliação positiva
himanshurauthan
Autoridade no assunto | Parceiro Elite
Autoridade no assunto | Parceiro Elite

No longer able to create website pages via API

resolver

@JoeHu 
Are you sending the request in JSON format. If so what data you are sending to headers. It should be "application/json" for POST request.

Rest I do not see any issue with your request. Was there any change made to the published APP in last hours as you mentioned the same was working fine for week or more.

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Avaliação positiva
JoeHu
Membro

No longer able to create website pages via API

resolver

@himanshurauthanYes I can confirm that I have set content type to "application/json", and I haven't modified the app for a while. Thanks for your help anyways.

0 Avaliação positiva
IsaacTakushi
HubSpot Employee
HubSpot Employee

No longer able to create website pages via API

resolver

Thanks for jumping in @himanshurauthan!

 

Welcome, @JoeHu.

 

This is a strange one. If you're authorizing with a Super Admin user, I definitely wouldn't expect you to encounter such an error.

 

Can you share your app ID and the Hub IDs of a few accounts you tested in? If there is more than one Super Admin in each account, can you confirm via DM which you used to connect the app?

 

 

Isaac Takushi

Associate Certification Manager
JoeHu
Membro

No longer able to create website pages via API

resolver

Hi @IsaacTakushi , thank you for your reply. I just sent you details via DM, please let me know if there is anything else I can provide. Thanks!

0 Avaliação positiva
JoeHu
Membro

No longer able to create website pages via API

resolver

Hi @IsaacTakushi , any update? Is there any other info I can provide? Thank you!

0 Avaliação positiva
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

No longer able to create website pages via API

resolver

Hey, @JoeHu.

 

Apologies for the delayed response. I've just sent you a direct message.

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva
JoeHu
Membro

No longer able to create website pages via API

resolver

Hi @IsaacTakushi , I just tested again and found that the issue disappeared by itself I didn't change any code and used same refresh token without re-authentication, so I am not really sure what happened. Anyways I am happy to see the issue got fixed. Thanks again!

0 Avaliação positiva
IsaacTakushi
HubSpot Employee
HubSpot Employee

No longer able to create website pages via API

resolver

Hey, @JoeHu.

 

Thanks for the update. I'm glad to hear that the behavior seems to have resolved itself. Please let me know if you encounter it again!

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva