Defining an Relation Expanding Expression

Defining an Relation Expanding Expression

The Backend Services RESTful API allows you to expand data relations when making read requests to content types.

To expand data, you need to define an expand expression. There are two ways to do that: using a query parameter or using a HTTP header.

Using a Query Parameter

If you want to specify an expand expression directly in your HTTP request query string, use the expand parameter and pass it the expand expression in a stringified JSON object format.

For example:

Request:
    GET https://api.everlive.com/v1/your-app-id/Activities?expand={"Likes":{"TargetTypeName":"Users","ReturnAs":"UsersWhoLikeTheActivity"}}

Using an HTTP Header

If you prefer to use an HTTP header to define the expand expression, use the X-Everlive-Expand HTTP header.

For example:

Request:
    GET https://api.everlive.com/v1/your-app-id/Activities
Headers:
    X-Everlive-Expand: {
        "Likes" : {
            "TargetTypeName": "Users",
            "ReturnAs": "UsersWhoLikeTheActivity"
        }
    }

See Also

To learn how to build the actual expand expressions, explore the following articles:

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.