2023.2 EN DE

    Show / Hide Table of Contents

    REST API Settings

    Description

    REST API allows external tools to control X-Creator using HTTP requests (including CORS support). All API requests have to be prefixed with the IP address of the X-Creator, the configured port, "api" and the API version. Example of a valid API request: http://192.168.0.1:9696/api/v1/experiences

    Environment Configuration

    Enable the REST API module so it is available for the Environment.

    X-Creator Configuration

    Enable the REST API module for one X-Creator in the Environment that should receive the REST requests and use the IP of this X-Creator when sending the requests.

    Port
    The port on which the requests are received

    Authentication
    Enables to define a Bearer Token (case sensitive) that must be added to the header of each request to access all endpoints. 'Bearer' has to be capitalized in the authorization header.

    X-Web Control

    width75

    Configuration

    • By starting the application, a default config file is created next to the executable if no config file found
    • Set values in config.json before starting the application to start with desired configuration (IPs, ports and crestron endpoints)
    Warning

    Do not position the executable inside of a directory with admin rights (recommend directory e.g.: C:\Users\Public\Documents)

    Config Sample File

    The following sample can be used as a starting point and copy-pasted to the config.json file. It contains all default values.

    {
        "WEB_CONTROL_PORT": "9697",
        "CREATOR_REST_API_IP": "http://192.168.0.100",
        "CREATOR_REST_API_PORT": "9696",
        "PIN_CODE": "9999",
        "CRESTRON_IP": "http://192.168.0.200",
        "CRESTRON_HOME_PATH": "/home",
        "CRESTRON_X_PANEL_URL": "https://192.168.1.11/shell-template/index.html?ipId=11"
    }
    

    API Documentation

    /alive

    GET

    Description
    Is the REST server alive.

    Responses

    Code Description
    200 Successful response

    /experiences

    GET

    Description
    Returns a list of all experiences with names, IDs and if set as favorites.

    Responses

    Code Description Schema
    200 Experience documents object
    401 Authentication token not valid

    /experiences/{id}

    GET

    Description
    Loads the experience with a given ID.

    Responses

    Code Description
    200 Successful response
    401 Authentication token not valid
    403 No experience with specified ID found

    /experiences/exit

    GET

    Description
    Leave current experience.

    Responses

    Code Description
    200 Successful response
    401 Authentication token not valid
    403 No experience loaded

    /experiences/current

    GET

    Description
    Returns name and ID of current experience.

    Responses

    Code Description
    200 Successful response
    401 Authentication token not valid
    403 No experience loaded

    /slides

    GET

    Description
    Returns a list of all slides from the current experience.

    Responses

    Code Description Schema
    200 Slide documents object
    401 Authentication token not valid
    403 No slides found or no experience loaded

    /slides/{id}

    GET

    Description
    Loads the slide with a given ID from the current experience.

    Responses

    Code Description
    200 Successful response
    401 Authentication token not valid
    403 No slides with specified ID found or no experience loaded

    /slides/next

    GET

    Description
    Loads the next slide from the current experience.

    Responses

    Code Description
    200 Successful response
    401 Authentication token not valid
    403 No next slide found or no experience loaded

    /slides/previous

    GET

    Description
    Loads the previous slide from the current experience.

    Responses

    Code Description
    200 Successful response
    401 Authentication token not valid
    403 No previous slide found or no experience loaded

    /slides/current

    GET

    Description
    Returns name and ID of current slide.

    Responses

    Code Description Schema
    200 Slide document object
    401 Authentication token not valid
    403 No slide found or no experience loaded

    Samples

    Load next slide:
    http://192.168.0.1:9696/api/v1/slides/next

    Request all experiences:
    http://192.168.0.1:9696/api/v1/experiences

    Tools

    Postman

    Use postman to simulate external HTTP-Requests:
    Postman

    Troubleshooting

    Response Code 403 - Forbidden

    If the endpoint is correct, but the requested action cannot be executed in the current situation, the status code "403 Forbidden" is returned.

    Response Code 404 - Not Found

    If a non-existent endpoint is requested, the status code "404 Not Found" is returned.

    Response Code 500 - Internal Server Error

    If this error occurs please contact the administrator. The status code "500 Internal Server Error" is returned.

    
    ☀
    ☾
    Back to top
    Generated by DocFX
    ☀
    ☾