I came across this article, which states that a language copy can be created with an API call like this:
POST https://tenant.sharepoint.com/sites/sitename/_api/sitepages/pages(<Source page ID>)/translations/create
The request body should be like this:
{
"request": {
"__metadata": {
"type": "SP.TranslationStatusCreationRequest"
},
"LanguageCodes": {
"results": ["nl-nl"]
}
}
}
This is not working for me, I get an error on this. More exactly, it creates a language copy for all available languages (despite the error message), while I need to create a language copy only for the specified language.
Here's the error:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
"message": {
"lang": "en-US",
"value": "The type SP.TranslationStatusCollection does not support HTTP PATCH method."
}
}
}
I tried a bunch of bodies to no avail (found this as well, changed set to create but runs into the same error).
What would be the correct request body?