403 error on post from axios

Strapi running on node 12

In strapi I have a collection-type called:
Display name: qty
I can run a get request like so:
const {data} = await axios
.get(‘http://myip/qties’, {
headers: {
Authorization:
Bearer ${jwtResp.data.jwt}
}
})

However when I try to post like so:
const {data} = await axios
.post(‘http://myip/qties’, {
data: {
quantity: 5,
discount: 5,
},
headers: {
Authorization:
Bearer ${jwtResp.data.jwt}
}
})
I get a 403 error
The fields are Quantity and Discount. Any ideas what I’m doing wrong?

Are you permission enabled for the user role to hit the endpoint?

Talked with this user via Slack, the issue was a missing JSON.stringify() on the data object

1 Like