How to add a translation to an existing node/entity using REST? I have a headless Drupal 8 and want to create a translation for an existing NODE using a POST request but cannot figure how to.
I know how to create, edit and delete a node but am unsure on how to add a translation to an existing node. If I add the langcode it creates a new node in that specified language but I want a translation for an existing node ID.
Please advise.
You have to load the node first and than addTranslation. You can check if exists or not. This way I was able to do it.
    $transNode = Node::load($nid);
    $transNode = $transNode-&gt;addTranslation(&quot;en&quot;);
    $transNode-&gt;title = $title_EN;
    $transNode-&gt;body= $body_EN;
    $transNode-&gt;field_1 = $field_1_EN;
    $transNode-&gt;save();