# Pages

## Get pages

<mark style="color:blue;">`GET`</mark> `https://api.petje.af/v1/pages`

This endpoint allows you to get pages that belongs to the authenticated user.\
\
Scope: `pages.read`

#### Query Parameters

| Name  | Type    | Description                                            |
| ----- | ------- | ------------------------------------------------------ |
| limit | integer | The number of pages to return                          |
| from  | string  | Offset the results to start after the provided page ID |

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Authorization | string | Access token using the `Bearer` method |

{% tabs %}
{% tab title="200 Pages successfully retrieved." %}

```
{
    "count": 4,
    "_embedded": {
        "pages": [
            {
                "resource": "pages",
                "id": "5SaEUOWD2b4dN7tJBKMB",
                "userId": "8jFy8VbRPTfkM1658U2IrwvIV7R2",
                "name": "Test 8",
                "slug": "test8",
                "validated": true,
                "_links": {
                    "self": {
                        "href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB",
                        "type": "application/hal+json"
                    },
                    "plans": {
                        "href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/plans",
                        "type": "application/hal+json"
                    },
                    "rewards": {
                        "href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/rewards",
                        "type": "application/hal+json"
                    }
                }
            },
            ...
        ]
    },
    "_links": {
        "self": {
            "href": "https://api.petje.af/pages",
            "type": "application/hal+json"
        },
        "next": null
    }
}
```

{% endtab %}
{% endtabs %}

## Get page detail

<mark style="color:blue;">`GET`</mark> `https://api.petje.af/v1/pages/:id`

Scope: `pages.read`

#### Path Parameters

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| pageId | string | The page ID |

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Authorization | string | Access token using the `Bearer` method |

{% tabs %}
{% tab title="200 " %}

```
{
    "resource": "pages",
    "id": "XdvyMNuQArs6KGRANDlT",
    "userId": "8jFy8VbRPTfkM1658U2IrwvIV7R2",
    "name": "Test 6",
    "slug": "test6",
    "validated": true,
    "_links": {
        "self": {
            "href": "https://api.petje.af/pages/XdvyMNuQArs6KGRANDlT",
            "type": "application/hal+json"
        },
        "plans": {
            "href": "https://api.petje.af/pages/XdvyMNuQArs6KGRANDlT/plans",
            "type": "application/hal+json"
        },
        "rewards": {
            "href": "https://api.petje.af/pages/XdvyMNuQArs6KGRANDlT/rewards",
            "type": "application/hal+json"
        }
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "status": 404,
    "title": "Not Found",
    "detail": "Page is not found",
    "_links": {
        "documentation": {
            "href": "https://docs.petje.af",
            "type": "text/html"
        }
    }
}
```

{% endtab %}
{% endtabs %}
