#Python Script for POST Request Authentication Issue

1 messages · Page 1 of 1 (latest)

forest oasisBOT
#

Hello. I'm new to payload and I'd like to perform a POST request on one of my collections to add new data from a python script. However, I'm not being able to Authenticate the POST request. Can you help me with this?

curl --request POST
--url http://local.nmas.live:3000/api/redirects
--header 'Authorization: API-Key 3138e9f8-5779-48d1-a732-782122600148'
--header 'Content-Type: application/json'
--data '{
"from": "/a/",
"to": "/b/",
"permanent": true
}'

latent fernBOT
#

Original message from @sharp solstice - Moved from #general message

#
sharp solstice
#

This is resolved. My rookie error was not to put the "users" (or whatever the slug is) string in the Authorization header: "users API-Key ....."

modest geyser
#

how? could you explain how you did it? I’m facing the same issue—I want to integrate different microservices, and my problem is similar: making a POST request without having to give full access to the endpoint/collection…

sharp solstice
#

Sure. You just have to add a header `Authorization: users APU-Key {your-api-key}

#

something linke this