# Retrieve enabled feature flags for the provided context. GET https://app.unleash-instance.example.com/api/frontend This endpoint returns the list of feature flags that the frontend API evaluates to enabled for the given context. Context values are provided as query parameters. If the Frontend API is disabled 404 is returned. Reference: https://docs.getunleash.io/api/get-frontend-features ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Retrieve enabled feature flags for the provided context. version: endpoint_frontendApi.getFrontendFeatures paths: /api/frontend: get: operationId: get-frontend-features summary: Retrieve enabled feature flags for the provided context. description: >- This endpoint returns the list of feature flags that the frontend API evaluates to enabled for the given context. Context values are provided as query parameters. If the Frontend API is disabled 404 is returned. tags: - - subpackage_frontendApi parameters: - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: frontendApiFeaturesSchema content: application/json: schema: $ref: '#/components/schemas/frontendApiFeaturesSchema' '401': description: >- Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`. content: {} '404': description: The requested resource was not found. content: {} components: schemas: FrontendApiFeatureSchemaVariantPayloadType: type: string enum: - value: json - value: csv - value: string - value: number FrontendApiFeatureSchemaVariantPayload: type: object properties: type: $ref: '#/components/schemas/FrontendApiFeatureSchemaVariantPayloadType' description: The format of the payload. value: type: string description: The payload value stringified. required: - type - value FrontendApiFeatureSchemaVariant: type: object properties: name: type: string description: The variants name. Is unique for this feature flag enabled: type: boolean description: Whether the variant is enabled or not. payload: $ref: '#/components/schemas/FrontendApiFeatureSchemaVariantPayload' description: Extra data configured for this variant feature_enabled: type: boolean description: Whether the feature is enabled or not. featureEnabled: type: boolean description: Use `feature_enabled` instead. required: - name - enabled frontendApiFeatureSchema: type: object properties: name: type: string description: Unique feature name. enabled: type: boolean description: Always set to `true`. impressionData: type: boolean description: >- `true` if the impression data collection is enabled for the feature, otherwise `false`. variant: $ref: '#/components/schemas/FrontendApiFeatureSchemaVariant' description: Variant details required: - name - enabled - impressionData frontendApiFeaturesSchema: type: object properties: toggles: type: array items: $ref: '#/components/schemas/frontendApiFeatureSchema' description: The actual features returned to the Frontend SDK required: - toggles ``` ## SDK Code Examples ```python import requests url = "https://app.unleash-instance.example.com/api/frontend" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://app.unleash-instance.example.com/api/frontend'; const options = {method: 'GET', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.unleash-instance.example.com/api/frontend" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.unleash-instance.example.com/api/frontend") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.unleash-instance.example.com/api/frontend") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://app.unleash-instance.example.com/api/frontend', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://app.unleash-instance.example.com/api/frontend"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/frontend")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```