API Headers [May 08]

:raising_hand_man: wkw replied

> it seems like nocoDB/Swagger doesnt support axios very well

just had a quick test. it works fine using axios. the data can be inserted into DB and it can be shown in NocoDB UI.

```

let headersList = {

“xc-auth”: “”,

“Content-Type”: “application/json; charset=utf-8”,

Accept: “application/json”,

};

let bodyContent = {

Title: “test”,

Title2: “test2”,

};

let reqOptions = {

headers: headersList,

body: bodyContent,

};

const { data } = axios.post(“<API_URL>”, bodyContent, reqOptions);

```

:raising_hand_man: wkw replied

“xc-auth”: “9bYhm5IA6taqBxFyey-K8nRrJeXMZ49JWonriVnu”,

“xc-token”: “9bYhm5IA6taqBxFyey-K8nRrJeXMZ49JWonriVnu”,

1. like o1lab said, u just need either one.

2. just a reminder - the value in your xc-auth is API token, not Auth token. You may take a look at https://docs.nocodb.com/developer-resources/accessing-apis to see the differences n how to retrieve it

:raising_hand_man: Ditmas replied

Thanks for the answord :slight_smile:

Autogenerated from discord


Join NocoDB’s community

DiscordTwitterRedditDocs