# REST API Post Request Localization

**URL:** <https://discourse.getcockpit.com/t/rest-api-post-request-localization/2887>\
**Category:** Cockpit v2\
**Created:** [October 24, 2023, 9:59pm UTC](https://discourse.getcockpit.com/t/rest-api-post-request-localization/2887 "2023-10-24T21:59:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterwyss](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/peterwyss/32/1394_2.png) [@peterwyss](https://discourse.getcockpit.com/u/peterwyss)\
**Post date:** [October 24, 2023, 9:59pm UTC](https://discourse.getcockpit.com/t/rest-api-post-request-localization/2887/1 "2023-10-24T21:59:19Z")

</div>

Hello,  
This is my JSON string for the post request:  
{  
“data”:  
{  
“titel”: “Ingwer-Kürbis-Suppe”,  
“\_id”: “ffcf37953462337796000279”,  
“text”: “Hokkaido-Kürbis-Suppe mit Ingwer und unserer Gemüsebouillon”,  
“preis1”: “11.00”,  
“preis2”: “8.50”,  
“\_modified”: 1698178260,  
“\_mby”: null

}  
}

How do I query the English title and text?  
Thanks for the support!

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [October 25, 2023, 4:07am UTC](https://discourse.getcockpit.com/t/rest-api-post-request-localization/2887/2 "2023-10-25T04:07:39Z")

</div>

Hi!

Can you post your query, and provide more details about what you want to achieve?

---

<div class="post-metadata">

**Author:** ![peterwyss](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/peterwyss/32/1394_2.png) [@peterwyss](https://discourse.getcockpit.com/u/peterwyss)\
**Post date:** [October 25, 2023, 8:34pm UTC](https://discourse.getcockpit.com/t/rest-api-post-request-localization/2887/3 "2023-10-25T20:34:31Z")

</div>

Hello, this is my query:

async function update(elem){  
const response = await fetch(‘https://\*\*\*\ ***.** /cockpit/api/content/item/suppen’, {  
method: ‘post’,  
headers: { ‘Content-Type’: ‘application/json’,  
},  
body: JSON.stringify(elem)  
});

I have localized the content on cockpit in two languages, English and German. All my attempts to update the content lead to this error: {“error”: “Item data is missing”}.

---

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [October 25, 2023, 11:24pm UTC](https://discourse.getcockpit.com/t/rest-api-post-request-localization/2887/4 "2023-10-25T23:24:56Z")

</div>

Can you try the following code?

```auto
async function update(elem) {
    const response = await fetch('https:// ****./cockpit/api/content/item/suppen', {
        method: 'post',
        headers: {
            'Content-Type': 'application/json',
        },
        body: JSON.stringify({
            data: elem
        })
    });
}

```
