I'm attempting to use the REST API outside of the browser but there are many questions.
1. How do you use the User's API-KEY in the authorization header? There is no documentation on that.
2. Every request from Postman returns 403: Forbidden even through the same request work in the browser there the same user is logged in. It doesn't even seem to reach API key authentication and is immediate.
I there proper documentation on how to actually use the API which seems to be an important feature of PayloadCMS?
I would like to use the User API key shown in the admin dashboard.
I tried this but also have 403 immediately.
I see, yes that works finally.
headers: {
Authorization: `JWT ${token}`,
}
});
replace token with the one your received from login endpoint.
for those API keys, header value is different
const response = await fetch('http://localhost:3000/api/pages', {
headers: {
Authorization: `users API-Key ${YOUR_API_KEY}`,
},
})
Star
Discord
online
Get dedicated engineering support directly from the Payload team.