My website is made with Ghost CMS. It’s node.js based. So I guess i must use the Javascript options.
I tried including the snippet code provided in NocoDB. But nothing shows on my website. Looked into the swagger thing. But code sample are only in Curl.
- Do I need to put the xcToken too? Where?
- Do I need to add more code to call data? How?
- Is there a full tutorial on how to handle api request in javascript with nocodb?
<script>
const options = {
method: 'GET',
headers: {
'xc-auth': 'eyJhbGciOiJIUzI1NiIsInR5cCICI6ImZiZWF1dmFpc0BnbWFpbC5jb20iLCJmaXJzdG5hbWUiOm51bGwsImxhc3RuYW1lIjpudWxsLCJpZCI6InVzX2JmcWczazhhbnc1aTl5Iiwicm9sZXMiOiJvcmctbGV2ZWwtY3JlYXRvcixzdXBlciIsInRva2VuX3ZlcnNpb24iOiIzZTRmZTVmN2NjY2RmNGEzZTRkNmU0MDcwMTJjNzUyMzExNDhmOTEwYjA2NmViZmQyODc0ODgzNDA5ZmY3MjI1NTUxYzQ4OTBiNjc5ZjY5YiIsImlhdCI6MTY5OTY0MTgyMywiZXhwIjoxNjk5Njc3ODIzfQ.yPaczTsnmR0hqnHmqCPimaZ0JtICdYnyDdzHugqi-NA'
}
};
fetch('https://nocodb.mynocodbsite.com/api/v1/db/data/noco/p_6xnrc3tumf5odf/Index%20des%20prix/views/Index-des-prix?offset=0&limit=25&where=', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
¸</script>