# Guest Relationship Campaigns

This API has been developed for our partners and clients, enabling them to easily access statistical data for the automated Email/SMS campaigns within Experience CRM. These campaigns, which are initiated before, during and after a guest's stay, are always linked to a specific reservation.&#x20;

The API returns detailed information through a set of arrays containing “configurations” and “performances”.&#x20;

The “configuration” section provides an in-depth look at the various attributes of each Customer Relationship Campaign, including business information, message type, campaign name, trigger conditions, sending times, subject lines in available languages for the campaign, and analytics tags.&#x20;

Meanwhile, the “performance” section outlines precise statistics for each campaign, detailing the number of messages sent, delivered, opened, links clicked, forms opened, and forms completed, all broken down by date.

### Request&#x20;

<mark style="color:green;">**GET**</mark> &#x20;

{% code overflow="wrap" %}

```
https://interface.experience-hotel.com/api/statistics/guest-relationship-campaigns/by-sending-date?date_start=2023-06-01&date_end=2023-06-02&hotel_id={{hotel_id}}
```

{% endcode %}

<table><thead><tr><th>Param</th><th>Format</th><th width="100">Required</th><th>Description</th></tr></thead><tbody><tr><td>date_start</td><td>YYYY-MM-DD</td><td>Required</td><td></td></tr><tr><td>date_end</td><td>YYYY-MM-DD</td><td>Required</td><td></td></tr><tr><td>hotel_id</td><td>Numeric</td><td>Optional</td><td>The unique identifier of a specific hotel for which you wish to retrieve campaign statistics. This parameter is optional. If your access token allows querying data for multiple hotels, you can use this parameter to limit the response to a specific hotel only. If this parameter is not used, the response will include the data for all accessible hotels.</td></tr></tbody></table>

### Response

Status Code 200 OK

{% code title="JSON" overflow="wrap" %}

```json
[
    {
        "configurataion": {
            "business_name": "Hôtel Test",
            "business_id": 1234,
            "message_type": "email",
            "name": "Pre-Check-In",
            "processus": "pre-check-in",
            "trigger": {
                "type": "period_before_arrival",
                "from_days": 0,
                "to_days": 3
            },
            "sending_time": {
                "from": 11,
                "to": 16
            },
            "subjects": {
                "0": {
                    "code": "fr",
                    "text": "Gagnez du temps au check-in !"
                },
                "1": {
                    "code": "en",
                    "text": "Save time at check-in!"
                }
            },
            "analytics_tags": {
                "source": null,
                "medium": null,
                "content": null
            }
        },
        "performances": [
            {
                "date": "2023-06-01",
                "sent": 5,
                "delivered": 5,
                "opened": 1,
                "clicked": 1,
                "form_opened": 0,
                "form_completed": 0
            },
            {
                "date": "2023-06-02",
                "sent": 1,
                "delivered": 0,
                "opened": 2,
                "clicked": 1,
                "form_opened": 1,
                "form_completed": 1
            },
            {
                "date": "2023-1062-03",
                "sent": 4,
                "delivered": 4,
                "opened": 3,
                "clicked": 1,
                "form_opened": 0,
                "form_completed": 0
            }
        ]
    },
    {
        "configuration": {
            "business_name": "Hôtel Test",
            "business_id": 1234,
            "message_type": "email",
            "name": "Post Stay",
            "processus": "post-stay",
            "trigger": {
                "type": "period_after_departure",
                "from_days": 1,
                "to_days": 7
            },
            "sending_time": {
                "from": 11,
                "to": 16
            },
            "subjects": {
                "0": {
                    "code": "fr",
                    "text": "((hotel_name)) - Enquête de satisfaction"
                },
                "1": {
                    "code": "en",
                    "text": "((hotel_name)) - Satisfaction survey"
                }
            },
            "analytics_tags": {
                "source": null,
                "medium": null,
                "content": null
            }
        },
        "performances": [
            {
                "date": "2023-06-01",
                "sent": 10,
                "delivered": 10,
                "opened": 4,
                "clicked": 1,
                "form_opened": 0,
                "form_completed": 0
            },
            {
                "date": "2023-06-02",
                "sent": 4,
                "delivered": 4,
                "opened": 1,
                "clicked": 2,
                "form_opened": 2,
                "form_completed": 1
            },
            {
                "date": "2023-06-03",
                "sent": 9,
                "delivered": 9,
                "opened": 9,
                "clicked": 6,
                "form_opened": 6,
                "form_completed": 4
            }
        ]
    }
]
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://experience-crm.gitbook.io/experience-crm-api/reporting/guest-relationship-campaigns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
