# List screen views

- Operation ID: `screen-views-list`
- HTTP method: `GET`
- Path: `/schema-service/v2/screen-views`
- [Human-readable API reference](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Screen-views/operation/screen-views-list)

## 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:
  /schema-service/v2/screen-views:
    get:
      tags:
        - Screen views
      summary: List screen views
      description: |
        Returns a paginated list of screen views.

        ---

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

        **API key permission required:** `SCHEMA_SERVICE_SCHEMA_CREATE`

        **User role permission required:** `assets_docs: create`
      security:
        - JWT: []
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: number
            format: int32
            minimum: 1
            default: 1
        - name: limit
          in: query
          required: false
          description: Limit of items per page
          schema:
            type: number
            format: int32
            default: 25
        - name: search
          in: query
          required: false
          description: A string to search for in resource names
          schema:
            type: string
        - name: directoryId
          in: query
          required: false
          description: UUID of the directory for filtering the results
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - DRAFT
              - ACTIVE
              - SCHEDULED
              - PAUSED
              - FINISHED
            description: Filter by status
        - name: feedId
          in: query
          required: false
          schema:
            type: string
            format: uuid
            description: UUID of the screen view feed for filtering the results
      responses:
        "200":
          description: List of screen views
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                  - data
                properties:
                  meta:
                    type: object
                    description: Pagination metadata
                    properties:
                      links:
                        type: array
                        description: Links to the neighboring pages and the first page
                        items:
                          type: object
                          required:
                            - url
                            - rel
                          properties:
                            url:
                              type: string
                              description: URL of the page, used for navigation
                            rel:
                              type: string
                              description: The type of relation to the current page. `first` is always the first page.
                              enum:
                                - first
                                - prev
                                - next
                      limit:
                        type: integer
                        format: int32
                        description: Limit of items per page
                      count:
                        type: number
                        nullable: true
                        description: Currently unused
                  data:
                    type: array
                    description: Array of analytics
                    items:
                      oneOf:
                        - type: object
                          required:
                            - id
                            - businessProfileId
                            - name
                            - status
                            - priority
                            - scheduled
                            - author
                            - content
                            - audience
                            - createdAt
                            - updatedAt
                            - directory
                            - feed
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: UUID of the screen view
                            businessProfileId:
                              type: integer
                              description: ID of the workspace where this screen view is saved
                            name:
                              type: string
                              description: Name of the screen view
                            description:
                              type: string
                              description: Description of the screen view
                            status:
                              type: string
                              enum:
                                - DRAFT
                                - ACTIVE
                                - SCHEDULED
                                - PAUSED
                                - FINISHED
                              description: |
                                Status of the screen view

                                - DRAFT: a screen view that is a work in progress, not complete for activation
                                - ACTIVE: a screen view that can be displayed to customers
                                - SCHEDULED: a screen view scheduled to activate later
                                - PAUSED: a screen view that is temporarily stopped and cannot be displayed
                                - FINISHED: a screen view that is stopped and cannot be displayed
                            priority:
                              type: integer
                              description: Priority determines which screen view to show to a customer if their profile matches the conditions of more than one screen view. `1` is the highest priority.
                              default: 99
                            scheduled:
                              type: boolean
                              description: Informs if the screen view has a defined schedule. Screen views scheduled to be published immediately after activation are considered to be scheduled, so only a draft screen view can have this property at `false`. Copied screen views inherit the schedule of their source.
                            author:
                              type: object
                              description: Information about the user who created this screen view
                              required:
                                - id
                              properties:
                                id:
                                  type: integer
                                  description: ID of the user
                                name:
                                  type: string
                                  description: Name of the user
                                avatar:
                                  type: string
                                  description: URL of the author's avatar image
                            content:
                              type: object
                              title: With document groups
                              description: Content of the screen view
                              required:
                                - json
                                - documents
                                - groups
                              properties:
                                json:
                                  type: object
                                  description: |
                                    JSON structure of the screen view. By default, a newly created screen view has the following `json` value:

                                    ```
                                    "collection": "{% screenviewcollection %}"
                                    ```
                                    The `{% screenviewcollection %}` insert is used to pick and display the documents from the documents in `documents` or `groups`.

                                    If this insert is not used, you must manually insert each document with `{% document slug%}`.
                                  additionalProperties:
                                    description: Any JSON entity or entities
                                documents:
                                  type: array
                                  description: An array of [documents](https://help.synerise.com/docs/assets/documents/introduction-to-documents/). If `groups` is used, this array must be empty.
                                  items:
                                    type: string
                                data:
                                  type: array
                                  description: An array of documents or Brickworks records
                                  items:
                                    oneOf:
                                      - type: object
                                        required:
                                          - slug
                                        properties:
                                          slug:
                                            type: string
                                            description: Slug of the document
                                            example: basket
                                            pattern: "[a-z0-9]+(?:-[a-z0-9]+)*"
                                      - type: object
                                        description: Object represents brickworks record id.
                                        required:
                                          - schemaId
                                          - objectId
                                        properties:
                                          schemaId:
                                            type: string
                                            format: uuid
                                          objectId:
                                            type: string
                                groups:
                                  type: array
                                  description: An array of [document groups](https://help.synerise.com/docs/assets/documents/introduction-to-documents/), If `documents` is used, this array must be empty.
                                  items:
                                    type: string
                                    format: uuid
                                    example: 43c97b25-4a10-45d0-99b7-d472eea2bb24
                                    description: UUID of the group
                                groupsOrder:
                                  type: boolean
                                  default: false
                                  description: By default, group are ordered for display by their priority. When this field is set to `true`, they are displayed according to their order in the `groups` array instead.
                            audience:
                              type: object
                              description: The profiles (clients) which have access to this resource
                              required:
                                - targetType
                              properties:
                                targetType:
                                  type: string
                                  description: |
                                    The method of defining the audience:
                                    - SEGMENT sets the audience to segmentations whose UUIDs are provided in `segments`
                                    - QUERY sets the audience to an analytics query provided in `query`
                                    - ALL sets the audience to all profiles in the database
                                  enum:
                                    - SEGMENT
                                    - QUERY
                                    - ALL
                                segments:
                                  type: array
                                  description: "An array of segmentation IDs. Used with `targetType: SEGMENT`"
                                  items:
                                    type: string
                                query:
                                  type: string
                                  description: "Stringified `analysis` object for the segmentation analytics engine. Used with `targetType: QUERY`. Refer to the [Analytics API Reference](https://developers.synerise.com/#operation/addSegmentationPOST_v2)."
                                  example: '{"analysis":{"title":"Unnamed segmentation","description":"","unique":true,"segments":[{"title":"Segmentation A","description":"","filter":{"matching":true,"expressions":[{"_id":"a9b76c8e-34bd-4ac3-be8f-f37041d126bd","name":"","type":"FUNNEL","matching":true,"funnel":{"_id":"5c759d73-49c6-409f-96a3-b569dff8f8ff","title":"Unnamed","completedWithin":null,"dateFilter":{"type":"RELATIVE","offset":{"type":"DAYS","value":0},"duration":{"type":"DAYS","value":30}},"steps":[{"_id":"78b97ae0-1bc5-45fb-82a4-4f1280cfbdff","title":"","action":{"id":944,"name":"page.visit"},"eventName":"page.visit","expressions":[]}],"exact":false}}]}}]}}'
                            createdAt:
                              type: string
                              description: Creation date
                              format: date-time
                            updatedAt:
                              type: string
                              format: date-time
                              description: Last update time
                            deletedAt:
                              type: string
                              format: date-time
                              description: Deletion time, if applicable
                              nullable: true
                            directory:
                              type: object
                              description: Details of the directory where the resource is assigned
                              required:
                                - id
                                - name
                                - createdAt
                                - default
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  description: |
                                    UUID of a directory. Directories can be used to organize documents and screen views for display in the Synerise Web Application.
                                    - If you want to organize documents for screen view campaigns, use document groups instead.
                                    - If you want to organize screen views for display, use screen view feeds instead.
                                name:
                                  type: string
                                  description: Name of the directory
                                createdAt:
                                  type: string
                                  format: date-time
                                  description: Date and time when the directory was created
                                default:
                                  type: boolean
                                  description: "`true` if this is the default directory"
                            feed:
                              type: object
                              description: Feeds are used to group screen views, similar to document groups.
                              required:
                                - id
                                - slug
                                - name
                                - createdAt
                                - default
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  description: UUID of the screen view feed
                                slug:
                                  type: string
                                  description: Unique slug of the screen view feed
                                name:
                                  type: string
                                  description: Name of the screen view feed
                                createdAt:
                                  type: string
                                  description: Creation date
                                  format: date-time
                                default:
                                  type: boolean
                                  description: Informs if this is the default screen view feed
        "400":
          description: See error message for details
          content:
            application/json:
              schema:
                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 error reference: [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html)
                  status:
                    type: integer
                    description: Error's HTTP status code
                  message:
                    type: string
                    description: Description of the problem
        "401":
          description: "Unauthorized: wrong consumer scope; token missing/expired/invalid; invalid API key; etc."
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: Time when the error occurred
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Description of the problem
                  status:
                    type: integer
                    format: int32
                    description: HTTP status code
        "403":
          description: Forbidden; insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: Time when the error occurred
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Description of the problem
                  status:
                    type: integer
                    format: int32
                    description: HTTP status code
        "404":
          description: Resource not found
          content:
            application/json:
              schema:
                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 error reference: [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html)
                  status:
                    type: integer
                    description: Error's HTTP status code
                  message:
                    type: string
                    description: Description of the problem
        "500":
          description: See error message for details
          content:
            application/json:
              schema:
                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 error reference: [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html)
                  status:
                    type: integer
                    description: Error's HTTP status code
                  message:
                    type: string
                    description: Description of the problem
      operationId: screen-views-list
      x-snr-doc-urls:
        - /api-reference/loyalty-and-engagement#tag/Screen-views/operation/screen-views-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/schema-service/v2/screen-views?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&status=SOME_STRING_VALUE&feedId=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/schema-service/v2/screen-views?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&status=SOME_STRING_VALUE&feedId=SOME_STRING_VALUE", headers=headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

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

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

            xhr.open("GET", "https://api.synerise.com/schema-service/v2/screen-views?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&status=SOME_STRING_VALUE&feedId=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

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

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/schema-service/v2/screen-views?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&status=SOME_STRING_VALUE&feedId=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            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.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/schema-service/v2/screen-views');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_NUMBER_VALUE',
              'limit' => 'SOME_NUMBER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'directoryId' => 'SOME_STRING_VALUE',
              'status' => 'SOME_STRING_VALUE',
              'feedId' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/schema-service/v2/screen-views?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&status=SOME_STRING_VALUE&feedId=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .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: Screen views
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.
````
