Feedback

This method can be applied on your server-side, in order to get all comments and grades from the feedback triggers.

Method: GET

URL: https://api.retargeting.app/v1/email-campaigns/json-feedback

Field Type Required Description
k number or text True The REST API Key can be found into your account Settings -> Integration -> REST API Key, second field.
u text True Your customer ID can be found in your account Settings -> Integration -> Customer ID, third field
t int Optional Unix timestamp (Example: 1725830491) in order to fetch feedback only starting from a certain date

Your account status must be in one of the states: PAID, PAYMENT ERROR or ACCOUNT SUSPENDED.

If your account is Inactive or Closed the API call will not work.

The API call will respond with JSON format.

Example

   <?php
   require_once "vendor/autoload.php";

   $apiURL = "https://api.retargeting.app/v1/email-campaigns/json-feedback";
   $apiKey = "REST_KEY";
   $customerId = "CUSTOMER_ID";

   $client = new GuzzleHttp\Client();

   $feedbackData = [
       "k" => $apiKey,
       "u" => $customerId
   ];

   $statusRequest = $client->request("GET", $apiURL, ["query" => $feedbackData]);

If the API call succeeds, then the response will be as seen below:

{
    status: "success",
    data: [{
        "order": {
            "orderno": "27047"
            "date": "2021-05-04 19:57:50"
        },
        "score": 10,
        "comment": "Great products",
        "added_on": "2021-05-20 14:25:27"
        "product_reviews": [
            {
                "realid": "2183",
                "added_on": "2022-03-20 11:45:32",
                "score": 9,
                "comment": "Perfect match for my summer outfits"
            }
        ]
    },
    {
        ...
    }]
}

Multiple product reviews found:

{
    status: "success",
    data: [{
        "order": {
            "orderno": "27047"
            "date": "2021-05-04 19:57:50"
        },
        "score": 10,
        "comment": "Great products",
        "added_on": "2021-05-20 14:25:27"
        "product_reviews": [
            {
                "realid": "2183",
                "added_on": "2022-03-20 11:45:32",
                "score": 9,
                "comment": "Perfect match for my summer outfits"
            },
            {
                "realid": "2182",
                "added_on": "2022-03-20 11:47:32",
                "score": 7,
                "comment": "Very comfortable"
            }
        ]
    },
    {
        ...
    }]
}

Product reviews can have score or comment returned as null (either one, but NEVER both):

{
    status: "success",
    data: [{
        "order": {
            "orderno": "27047"
            "date": "2021-05-04 19:57:50"
        },
        "score": 10,
        "comment": "Great products",
        "added_on": "2021-05-20 14:25:27"
        "product_reviews": [
            {
                "realid": "2183",
                "added_on": "2022-03-20 11:45:32",
                "score": null,
                "comment": "Perfect match for my summer outfits"
            },
            {
                "realid": "2182",
                "added_on": "2022-03-20 11:47:32",
                "score": 7,
                "comment": null
            }
        ]
    },
    {
        ...
    }]
}

If no product reviews are found:

{
    status: "success",
    data: [{
        "order": {
            "orderno": "27047"
            "date": "2021-05-04 19:57:50"
        },
        "score": 10,
        "comment": "Great products",
        "added_on": "2021-05-20 14:25:27"
        "product_reviews": []
    },
    {
        ...
    }]
}

If the API call fails, the response will be as seen below:

When the customer id parameter is not provided:

{
    status: "error",
    message: "No customer id provided!"
}
                    

When the rest key parameter is not provided:

{
    status: "error",
    message: "No rest key provided!"
}
                    

When the rest key parameter is invalid:

{
    status: "error",
    message: "Incorrect rest key!"
}
                    

When the customer id parameter is invalid:

{
    status: "error",
    message: "No customer found with the provided id!"
}
                    

When the account is not active:

{
    status: "error",
    message: "Your account is not active!"
}
                    

When something went wrong:

{
    status: "error",
    message: "Something went wrong"
}