# Get expressions for profile card

- Operation ID: `analytics2-client-card-expressions-get`
- HTTP method: `POST`
- Path: `/analytics/{Namespace}/expressions/visible-for-client/by/{IdentifierType}`
- [Human-readable API reference](https://hub.synerise.com/api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-client-card-expressions-get)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /analytics/{Namespace}/expressions/visible-for-client/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Expressions"
      summary: Get expressions for profile card
      description: |
        Retrieve expressions to display on a profile's card in the Profiles module (`"isVisibleForClientProfile": true` in the [expression config](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/addExpressionPOST)).


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ANALYTICS_BACKEND_EXPRESSION_FOR_CLIENT_READ`

        **User role permission required (at least one):** `analytics: read`, `client_analytics_preview: read`
      operationId: analytics2-client-card-expressions-get
      parameters:
        - name: IdentifierType
          in: path
          description: Profile identifier type
          required: true
          style: simple
          explode: false
          schema:
            type: string
            enum:
              - id
              - uuid
              - email
              - custom_identify
        - name: Namespace
          in: path
          description: Namespace. Currently, only `profiles` is available.
          required: true
          style: simple
          explode: false
          schema:
            type: string
            enum:
              - profiles
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifierValue:
                  type: string
                  description: Value of the selected identifier. Note that IDs must also be sent as strings.
              required:
                - identifierValue
      responses:
        "200":
          description: List of calculated expressions configured as visible on the profile card
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                      description: |
                        UUID of the analysis
                      example: 5370bf3c-2dfa-4e89-98ff-07100cffee6c
                    name:
                      type: string
                      description: Name of the analysis
                      example: Nice people who read the documentation
                    result:
                      description: Result of the analysis
                      oneOf:
                        - type: object
                          example:
                            success: true
                            value: "123"
                          properties:
                            success:
                              type: boolean
                              description: Always `true`
                            value:
                              type: string
                              description: Calculation result
                          required:
                            - success
                            - value
                          title: Successful calculation
                        - type: object
                          example:
                            success: false
                            errorMessage: Analytic or one of nested analytics does not exist
                            httpStatus: 400
                            errorCode: ANA-002
                          properties:
                            success:
                              type: boolean
                              description: Always `false`
                            errorMessage:
                              type: string
                              description: Details of the error which caused the calculation failure
                            httpStatus:
                              type: integer
                              description: HTTP status of the error which caused the calculation failure
                            errorCode:
                              type: string
                              description: Code of the error which caused the calculation failure
                          required:
                            - errorMessage
                            - success
                          title: Failed calculation
                  required:
                    - id
                    - name
                    - result
        4XX:
          description: See error message for details
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      source:
                        type: object
                        nullable: true
                        description: Information about a parameter that caused the error, if applicable.
                        properties:
                          pointer:
                            type: string
                            description: Information about a parameter
                          value:
                            type: string
                            nullable: true
                            description: Currently unused
                      errors:
                        type: array
                        description: An array of errors, if applicable
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: string
                              format: date-time
                              description: Time when the error occurred
                            errorCode:
                              type: string
                              description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                            httpStatus:
                              type: integer
                              description: HTTP status code
                            message:
                              type: string
                              description: Description of the problem
                            traceId:
                              type: string
                              description: Currently unused
                              nullable: true
                            help:
                              type: string
                              nullable: true
                              description: Currently unused
                  - type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                        description: Time when the error occurred
                      errorCode:
                        type: string
                        description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                      httpStatus:
                        type: integer
                        description: HTTP status code
                      message:
                        type: string
                        description: Description of the problem
                      traceId:
                        type: string
                        description: Currently unused
                        nullable: true
                      help:
                        type: string
                        nullable: true
                        description: Currently unused
        5XX:
          description: See error message for details
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      source:
                        type: object
                        nullable: true
                        description: Information about a parameter that caused the error, if applicable.
                        properties:
                          pointer:
                            type: string
                            description: Information about a parameter
                          value:
                            type: string
                            nullable: true
                            description: Currently unused
                      errors:
                        type: array
                        description: An array of errors, if applicable
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: string
                              format: date-time
                              description: Time when the error occurred
                            errorCode:
                              type: string
                              description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                            httpStatus:
                              type: integer
                              description: HTTP status code
                            message:
                              type: string
                              description: Description of the problem
                            traceId:
                              type: string
                              description: Currently unused
                              nullable: true
                            help:
                              type: string
                              nullable: true
                              description: Currently unused
                  - type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                        description: Time when the error occurred
                      errorCode:
                        type: string
                        description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                      httpStatus:
                        type: integer
                        description: HTTP status code
                      message:
                        type: string
                        description: Description of the problem
                      traceId:
                        type: string
                        description: Currently unused
                        nullable: true
                      help:
                        type: string
                        nullable: true
                        description: Currently unused
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-client-card-expressions-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"identifierValue\":\"string\"}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "identifierValue": "string"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({identifierValue: 'string'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"identifierValue":"string"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\"}")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: "Analytics: Expressions"
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
