#API Key for Rest API

1 messages · Page 1 of 1 (latest)

static tulip
#

Good afternoon everyone. I have a collection called arrests, that I would like to use the API to upload too. I enabled ApiKeys on my users collection as from what I read in a few comments on here that should authenticate the request as the user. When I call the endpoint however I constantly get a 403. This is how I have my fetch request setup.

const req = await fetch('http:localhost:3000/api/arrests', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: ${process.env.PAYLOAD_API_KEY},
},
});

Any help would be greatly appreciated.

lean gateBOT
final ore