cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Extract the data from OData in all available languages

pmuni
Explorer
0 Likes
574

Hi experts

Is there any way we can extract the data from OData in all available languages?

We only see the option to set a language on the user within communication agreements.

We need to do it in only one call

View Entire Topic
AlanChen
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Pablo,

You can fetch data in other languages. Kindly refer to the Blog OData language | SAP Community.

Specifically, I achieve this by a piece of JS code below. Just for your reference.

import axios from 'axios';

const URL = 'https://myXXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/LeadCollection'

const auth = {
    username: "XXXXXXXXXX",
    password: "XXXXXXXXXX"
} async function getOneLead() { const res = await axios.get(URL + '?$top=1&$format=json', { auth, headers: { "Accept-Language": 'zh-CN' // in Chinese } }) console.log(res.data.d.results) } getOneLead()

For the language code, you may refer to the page: Language Code Table (lingoes.net).

If this helps, kindly mark the answer as the best, thanks.

Feel free to get back to me if any further queries.

BR,
Alan