Hey @tcdigital! 👋
Without more details it is hard to tell what could be the root of the issue. Could you link a page where this can be experienced?
Also make sure this is not related to any cache or optimization plugin you might have running. Make sure to disable any such plugin temporarily to see if this helps.
The issue seems to be with the way this plugin build URLs:
When the page is using translatepress with a default language directory (and maybe any similar multilingual plugin), the rest URL that is being built is
https://example.org/de_de/wp-json/mwai/v1/start_session
This works fine for GET, because GET requests get redirected. But POST doesn’t allow redirects. Therefore, no session can be started.
Or is this an issue with Translatepress itself?
Solved using the following functions.php snippet where /de/ is my default language. This still seems like a dirty hack so I would be interested if this is something that can be addressed by either AI Engine or Translatepress.
add_filter(‘rest_url’, function ($url, $path, $blog_id, $scheme) {
if ($path === “/”) {
$url = str_replace(‘/de/’, ‘/’, $url);
}return $url;
}, 99999999, 4);