简体   繁体   中英

How to add Flagsmith API authentication header

I am trying to consume the Flagsmith APIs as documented here .

It seems some APIs like -- /flags/ need "x-environment-key" header, which is working.

But for others like /environments/ "x-environment-key" does not work. I have tried a bearer token authorisation by obtaining the API key ( Authorization: Bearer <> ). But that doesn't work either. There is no clear documentation on the authentication mechanism ( or I have missed it ).

Can someone throw some pointers?

x-environment-key is for the SDK endpoints, where as /environments is an admin endpoint used in the dashboard to list a project's environments. Those endpoints are protected via an API token, so you'd need to send

authorization: Token $API_TOKEN

You can find your API token in your account settings under keys

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM