API V3 Endpoints General Structure

V3 Endpoints have been added to make use of Passcreator's query language that is not supported in older endpoints. Older endpoints will not receive support for the query language in the future but will continue to work.

  • Requests can contain data and an optional filter in the HTTP request body.
  • A filter can contain a query (see Query Language) that can be used to apply the request only to a defined subset of passes.
  • If you don't want to get all available fields in the response you can also apply a filter fields as an array to only get the fields you need.

Requests

POST Requests

A POST request will accept at least a data object.
See individual Endpoint descriptions for supported fields.

Examples for POST request bodies

A POST request body with "data" containing a JSON object:

{
    "data": {
        "firstname": "David",
        "age": 30,
        "country": "Germany"
    }
}

A bulk POST request will accept at least an array of objects.
See individual Endpoint descriptions for supported fields.

A bulk POST request body with "data" containing an array of objects:

{
    "data": [
        {
            "firstname": "David",
            "age": 30,
            "country": "Germany"
        },
        {
            "firstname": "Ray",
            "age": 31,
            "country": "Germany"
        },
    ]  
}

GET Requests

A GET request that supports filter can look like this.
See individual Endpoint descriptions for supported fields.

Example for a GET request body

A GET request body with a JSON "filter" object:

{
    "filter": {
        "query": {
            "templateId": "2d1b5f7f-26df-41c6-980f-ed0709f1170d",
            "groups": [
                [
                    {
                    "field": "firstname",
                    "operator": "contains",
                    "value": ["David", "Ray", "Timo"]
                    },
                    {
                    "field": "country",
                    "operator": "equals",
                    "value": ["Germany"]
                    },
                    {
                    "field": "age",
                    "operator": "greaterThan",
                    "value": [60]
                    }
                ],
                [
                    {
                    "field": "firstname",
                    "operator": "contains",
                    "value": ["Alex", "Marc"]
                    },
                    {
                    "field": "country",
                    "operator": "equals",
                    "value": ["Spain"]
                    }
                ]
            ]
        },
        "fields": ["identifier", "firstname", "country"]
    }
}

Responses

Response Body

A response body will always contain a JSON object with the following properties:

  • Name
    statusCode
    Type
    integer
    (mandatory)
    Description

    The HTTP status code of the response.

  • Name
    success
    Type
    boolean
    (mandatory)
    Description

    Indicates whether the execution of the request has been successful.

    Bulk operations that partially fail will return "success": true
    Check the corresponding process to get more information about the error

  • Name
    description
    Type
    string
    (optional)
    Description

    A description of what has been done.

  • Name
    errors
    Type
    array<string>
    (optional)
    Description

    Messages of errors that may have occurred.

  • Name
    count
    Type
    integer
    (optional)
    Description

    Number of objects that have been affected by the request. Meaning depends on type of request.

  • Name
    responseMetaData
    Type
    null | object
    (optional)
    Description

    Optional object with properties providing additional information depending on the functionality of the endpoint (e.g. number of total search results for a search). If no such information is provided by the endpoint, the value will be null.

  • Name
    data
    Type
    object | array<object>
    (mandatory)
    Description

    The value depends on the type of the request and the response.
    For GET requests that can return multiple results the value will be an array of resulting objects. In other cases it will be of type object.

Example for a response body

A GET request body with a JSON "filter" object:

{
    "statusCode": 200,
    "success": true,
    "description": "A description of what has been done",
    "errors": ["Error1", "Error2"],
    "count": 123,
    "responseMetaData": null,
    "data": {}
}

Further details are found in the documentation for each endpoint.