Prepr Documentation

Prepr Documentation

Welcome to the Prepr Documentation. You'll find comprehensive guides and documentation to help you start working with Prepr as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

How to use fields

Not all fields in a node are returned by default. You can choose the fields that you want returned with the parameter fields. This is really useful for making your API requests more efficient and fast.

Nested fields

Some endpoints contain more than one object-type. Especially if fields is used in a request. Some of you know have maybe worked before with nested fields. The support is the same as used by the Facebook Graph API.

Example

We use the example above (/publications?fields=tags,business_hours) this request contains a list with publications. But the publication objects contains extra objects like tags and business hours. Because you can add fields to your request, you can use fields for publication as well the sub objects (tags & business hours). To clarify this a publication where we added some tags.

{
    "id": "812d722ab-7f85-4801-98e7-b1bde250910f",
    "created_on": "2018-02-16T23:56:05+00:00",
    "changed_on": "2018-02-17T14:53:52+00:00",
    "published_on": "2018-02-16T23:55:00+00:00",
    "unpublish_on": null,
    "label": "Post",
    "status": "published",
    "slug": "lorem-ipsum-dolor-sit-amet-consectetur",
    "tags": [
        {
            "id": "142505c3-48c224-422c-bfdb-2daa3bf5890f",
            "created_on": "2017-04-24T13:35:30+00:00",
            "changed_on": null,
            "label": "Tag",
            "name": "Den Bosch",
            "slug": "den-bosch",
            "color": null
        },
        {
            "id": "53d2defa-95293-47be-a05d-3524bb50f6c7d",
            "created_on": "2017-04-24T13:35:42+00:00",
            "changed_on": null,
            "label": "Tag",
            "name": "Nijmegen",
            "slug": "nijmegen",
            "color": "#003366"
        },
        {
            "id": "2826f23c7-bddf-4be8-bcf4-ed123ee6123f5",
            "created_on": "2017-04-24T13:25:39+00:00",
            "changed_on": null,
            "label": "Tag",
            "name": "Heerlen",
            "slug": "heerlen",
            "color": null
        }
    ]
}