Cannot create blog post language variation via API

Hello,

I have a problem with localizing blog post, where I am trying to create its language variation via endpoint:

cms/v3/blogs/posts/multi-language/create-language-variation

with data:

{
 "blogPostId": "45766901518",
 "language": "it",
 "primaryLanguage": "en",
 "contentGroupId": "5400250929"
}

I have a blog post that is localized to English and I want to add language variation for Italian. But I get this 400 error: `Master blog post language cannot be changed.`

This happens no mather what primary language I set. If I omit the primary language, I get

‘Master with id: 45766901518 has same language as variation: en’.

So what’s the correct behavior and what am I expected to set to the request body to make a correct language variation? Is there any description or article about working with the endpoint? There is no any specification in documentation I found in here .

Thank you for your response,

Ondrej

@piersg , have you toyed with this before?

Hi,

Same issue for me.

Hi, I experience the same issue. I don’t know how to proceed here, it’s urgent!

Hi there,

I’m experiencing the same issue and I couldn’t figure out the solution. I would appreciate if anyone could help on this!

I’m using the following parameters in my requests:

URL: https://api.hubapi.com/cms/v3/blogs/posts/multi-language/create-language-variation?hapikey=

Data: {“id”: “67470989399”, “primaryLanguage”: “en”, “language”: “es”, “contentGroupId”: 67479844256}

Content Type: application/json

And I’m getting the following error:

{
"correlationId": "8b4f1bec-af62-411e-8a62-369e84a8a862",
"message": "Master blog post language cannot be changed.",
"status": "error"
}

Regards

Hi,
as I commented earlier, I have opened a ticket regarding this issue. Today I finally got good news that this issue is fixed. The endpoint now does work as expected.

I used Python and this is the function I built to create language variations of blog posts:

import json
import requests

def create_lang_by_id(type: str, language: str, key, id, content_group_id):
 querystring = { "hapikey": key }
 url = "https://api.hubapi.com/cms/v3//blogs/posts/multi-language/create-language-variation"
 headers = {
 "accept": "application/json",
 "content-type": "application/json"
 }

 payload = json.dumps({
 "id": str(id),
 "language": language,
 "primaryLanguage": "en",
 "contentGroupId": str(content_group_id)
 })

 response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
 return response

Best,
Fabian

Hey, @FabianRichter! Thanks again for filing this as a support ticket :raising_hands: We appreciate YOU!

Thanks @FabianRichter! Now it works well on my end :blush:

This issue has been resolved as @FabianRichter mentioned! You can create language variations via the endpoint as expected.