on 08-08-2023 11:11 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.