Introduction
To use this api you should generate your account api token in Rating Captain app panel Rating Captain panel
How to generate api token
1. Register / Login into Rating Captain app.
2. Go to Account settings
3. Click Generate Api key.
Where is website token
1. Register / Login into Rating Captain app.
2. Go website tab
3. In right section you can find section "website details". Your website token is placed in Website token hash.
Authenticating requests
To authenticate requests, include a api-token
header with the value "{YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
Events
Mark emails with events types
requires authentication
Example request:
curl --request POST \
"https://api.ratingcaptain.com/api/v1/emails/events" \
--header "api-token: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "website-token: {WEBSITE HASH (TOKEN)}" \
--data "{
\"event\": \"opened_email\",
\"ratingcaptain_email_id\": 1245294.15961672
}"
const url = new URL(
"https://api.ratingcaptain.com/api/v1/emails/events"
);
const headers = {
"api-token": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
"website-token": "{WEBSITE HASH (TOKEN)}",
};
let body = {
"event": "opened_email",
"ratingcaptain_email_id": 1245294.15961672
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"message": "Event processed successfully",
"rate": {
"id": 4274755,
"website_id": 74,
"email": "[email protected]",
"link": "https://www.examle.com",
"template_id": 57,
"send_date": "2023-01-06",
"is_send": 1,
"click": 0,
"active": 1,
"deleted_at": null,
"created_at": "2022-12-30T09:00:18.000000Z",
"updated_at": "2022-12-30T10:08:25.000000Z",
"hash": "0d0a78fc13c887faa1cb2845d1452bdb",
"data": "[]",
"country": "PL",
"order_lang": null,
"reaction": null,
"user_message": null,
"external_id": "12345667",
"click_date": null,
"products_email_date": null,
"rabat_send": 0,
"rabat_code": null,
"reaction_seen": 0,
"name": null,
"surname": null,
"sign_out": 0,
"respond_history": [],
"done": 0,
"type": null,
"session_id": null,
"click_history": [],
"phone": "555666777",
"sent_by_sms": 0,
"platform_id": 3404,
"coupon_sent_at": null,
"sent_by_redirect": 0,
"from_popup": 0,
"opened_at": "2022-12-30 10:08:25",
"from_qr_code": false,
"send_sms_date": "2023-01-06",
"order_source": "default",
"click_date_diff": null,
"import": null,
"has_default_id": true,
"products_rate_link": "https://example.com/product_link",
"hasAnyUserMessage": false,
"products_email_date_calculated": "None",
"like_link": "https://example.com/like_link",
"dislike_link": "https://example.com/dislike_link",
"chat_link": "https://example.com/chat_link",
"predict_send_date": null
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reviews
Fetching product reviews
requires authentication
You can fetch product reviews from your connected website.
Example request:
curl --request GET \
--get "https://api.ratingcaptain.com/api/v2/rates" \
--header "api-token: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "website-token: YOUR-WEBSITE-TOKEN" \
--data "{
\"product_id\": \"corporis\",
\"page\": 62,
\"per_page\": 10,
\"after_date\": \"2024-10-15\",
\"before_date\": \"2024-10-15\"
}"
const url = new URL(
"https://api.ratingcaptain.com/api/v2/rates"
);
const headers = {
"api-token": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
"website-token": "YOUR-WEBSITE-TOKEN",
};
let body = {
"product_id": "corporis",
"page": 62,
"per_page": 10,
"after_date": "2024-10-15",
"before_date": "2024-10-15"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"current_page": 1,
"data": [
{
"uid": "product_2515429",
"external_id": "512",
"created_at": "2022-11-09 19:55:23",
"platform": null,
"product_id": "test",
"rate": 5,
"description": "Example description",
"rate_title": "Example title",
"name": "Example user name",
"email": "[email protected]"
}
],
"first_page_url": "https://api.ratingcaptain.com/api/v2/rates?page=1",
"from": 1,
"last_page": 1712,
"last_page_url": "https://api.ratingcaptain.com/api/v2/rates?page=1712",
"links": [
{
"url": null,
"label": "«Previous",
"active": false
},
{
"url": "https://api.ratingcaptain.com/api/v2/rates?page=2",
"label": "Next "",
"active": false
}
],
"next_page_url": "https://api.ratingcaptain.com/api/v2/rates?page=2",
"path": "https://api.ratingcaptain.com/api/v2/rates",
"per_page": 1,
"prev_page_url": null,
"to": 1,
"total": 1712
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Fetching reviews
requires authentication
You can fetch website reviews from your connected platforms and internal Rating Captain platform.
Example request:
curl --request GET \
--get "https://api.ratingcaptain.com/api/v2/simple_rates" \
--header "api-token: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "website-token: YOUR-WEBSITE-TOKEN" \
--data "{
\"page\": 61,
\"per_page\": 22,
\"after_date\": \"2024-10-15\",
\"before_date\": \"2024-10-15\",
\"rvs_types\": [
\"organic_to_ptm_neg\"
],
\"rv_stars_from\": 5,
\"rv_stars_to\": 9,
\"rv_text_len_from\": 262456.140259,
\"rv_text_len_to\": 73437444,
\"rv_text_contains_phrase\": \"szpaqugwwkxfvgxqtwws\",
\"order_by\": \"stars\",
\"order_type\": \"desc\"
}"
const url = new URL(
"https://api.ratingcaptain.com/api/v2/simple_rates"
);
const headers = {
"api-token": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
"website-token": "YOUR-WEBSITE-TOKEN",
};
let body = {
"page": 61,
"per_page": 22,
"after_date": "2024-10-15",
"before_date": "2024-10-15",
"rvs_types": [
"organic_to_ptm_neg"
],
"rv_stars_from": 5,
"rv_stars_to": 9,
"rv_text_len_from": 262456.140259,
"rv_text_len_to": 73437444,
"rv_text_contains_phrase": "szpaqugwwkxfvgxqtwws",
"order_by": "stars",
"order_type": "desc"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (422):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Wrong api-token"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store order in Rating Captain You can use this endpoint to store order in Rating Captain. You can attach products in this request
Example request:
curl --request POST \
"https://api.ratingcaptain.com/emails" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"external_id\": \"ord_12515\",
\"hash\": \"{YOUR WEBSITE TOKEN (HASH)}\",
\"email\": \"[email protected]\",
\"link\": \"recommended-not-use-this\",
\"phone\": \"630 511 231\",
\"send_date\": \"recommended-not-use-this\",
\"send_after\": 0,
\"products\": [
\"beatae\"
],
\"platform\": {
\"external_id\": \"WQ\"
},
\"order_source\": \"laudantium\"
}"
const url = new URL(
"https://api.ratingcaptain.com/emails"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"external_id": "ord_12515",
"hash": "{YOUR WEBSITE TOKEN (HASH)}",
"email": "[email protected]",
"link": "recommended-not-use-this",
"phone": "630 511 231",
"send_date": "recommended-not-use-this",
"send_after": 0,
"products": [
"beatae"
],
"platform": {
"external_id": "WQ"
},
"order_source": "laudantium"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 4065637,
"errors": [],
"like_link": "https://api.ratingcaptain.com/rate/click/d04792b9bd5ef5d4d05a56ee1bd93bdb",
"dislike_link": "https://api.ratingcaptain.com/rate/d04792b9bd5ef5d4d05a56ee1bd93bdb/message",
"products_link": "https://api.ratingcaptain.com/products/rate/d04792b9bd5ef5d4d05a56ee1bd93bdb",
"summary_js": null,
"message": "success"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Unsubscribed
Get unsubscribed emails from all user websites.
requires authentication
Example request:
curl --request GET \
--get "https://api.ratingcaptain.com/api/v2/unsubscribed" \
--header "api-token: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "website-token: {WEBSITE HASH (TOKEN)}" \
--data "{
\"created_at\": {
\"from\": \"2024-10-15T12:29:32\",
\"to\": \"2058-05-16\"
}
}"
const url = new URL(
"https://api.ratingcaptain.com/api/v2/unsubscribed"
);
const headers = {
"api-token": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
"website-token": "{WEBSITE HASH (TOKEN)}",
};
let body = {
"created_at": {
"from": "2024-10-15T12:29:32",
"to": "2058-05-16"
}
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"email": "[email protected]",
"sign_out_at": "2023-01-31T13:08:11.000000Z"
}
],
"links": {
"first": "https://api.ratingcaptain.com/v2/unsubscribed?page=1",
"last": "https://api.ratingcaptain.com/v2/unsubscribed?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "«Previous",
"active": false
},
{
"url": "https://api.ratingcaptain.com/v2/unsubscribed?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next "",
"active": false
}
],
"path": "https://api.ratingcaptain.com/v2/unsubscribed",
"per_page": 15,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User
Get authenticated user with websites
Example request:
curl --request POST \
"https://api.ratingcaptain.com/api/v2/user_info" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"[email protected]\",
\"password\": \"testpassword\"
}"
const url = new URL(
"https://api.ratingcaptain.com/api/v2/user_info"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "[email protected]",
"password": "testpassword"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 1,
"name": "Test",
"email": "[email protected]",
"websites": [
{
"name": "test1",
"url": "http://test1.pl/store",
"script_link": "https://api.ratingcaptain.com/js_v2/test1",
"widgets": [
{
"name": "Saved widgets",
"type": "popup",
"preview": "https://api.ratingcaptain.com/api/widgets_v2/preview/1000033",
"code": "<div data-widget='100033'></div>"
},
{
"name": "Saved widgets",
"type": "frustration_reduction",
"preview": "https://api.ratingcaptain.com/api/widgets_v2/preview/1000033",
"code": "<div data-widget='100076'></div>"
}
],
"token": "test1"
},
{
"name": "Test",
"url": "https://www.test.com/pl/",
"script_link": "https://api.ratingcaptain.com/js_v2/51531515151",
"widgets": [
{
"name": "Saved widgets",
"type": "home",
"preview": "https://api.ratingcaptain.com/widgets_v2/preview/111222333",
"code": "<div data-widget='111222333'></div>"
}
],
"token": "51531515151"
},
{
"name": "TEST",
"url": "http://test.com",
"script_link": "https://api.ratingcaptain.com/js_v2/41241414141",
"widgets": [],
"token": "41241414141"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Widgets
Fetch widgets from API
requires authentication
Example request:
curl --request GET \
--get "https://api.ratingcaptain.com/api/v2/widgets" \
--header "api-token: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "website-token: {WEBSITE HASH (TOKEN)}" \
--data "{
\"page\": 45,
\"per_page\": 19,
\"from\": \"2024-10-15\",
\"to\": \"2024-10-15\"
}"
const url = new URL(
"https://api.ratingcaptain.com/api/v2/widgets"
);
const headers = {
"api-token": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
"website-token": "{WEBSITE HASH (TOKEN)}",
};
let body = {
"page": 45,
"per_page": 19,
"from": "2024-10-15",
"to": "2024-10-15"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 100839,
"website_id": 8,
"layout_id": 1,
"style_id": 1,
"font_family": null,
"font_color": null,
"data": {
"data": {
"layout_details": {
"full_width": "1"
}
},
"colors": {
"font": "Inter",
"mode": "light",
"star": "#FECD2F",
"stars": "#FECD2F",
"accent": "#4D55F8"
},
"header": {
"active": true,
"average": true,
"sortable": true,
"filterable": true,
"show_title": true,
"title_text": "Example title",
"border_color": "#E7EBF8",
"border_width": "0",
"starsOptions": {
"bold": false,
"align": "center",
"color": "#8991AE",
"italic": false,
"font_size": "14",
"underline": false
},
"titleOptions": {
"bold": true,
"align": "center",
"color": "#303445",
"italic": false,
"font_size": "28",
"underline": false
},
"border_radius": "10",
"reviews_count": true,
"show_subtitle": true,
"subtitle_text": "Read reviews",
"averageOptions": {
"bold": false,
"align": "left",
"color": "#303445",
"italic": false,
"font_size": "14",
"underline": false
},
"average_layout": "horizontal",
"can_add_review": true,
"display_average": true,
"filter_by_stars": true,
"subtitleOptions": {
"bold": false,
"align": "center",
"color": "#8991AE",
"italic": false,
"font_size": "18",
"underline": false
},
"background_color": "#FFFFFF",
"average_font_size": 20,
"add_review_button_text": "Write review"
},
"style_id": "1",
"layout_id": "1",
"card_styles": {
"show_date": true,
"show_photo": true,
"show_stars": true,
"show_source": true,
"border_color": "#E7EBF8",
"border_width": "1",
"content_type": "full",
"show_content": true,
"authorOptions": {
"bold": true,
"align": "left",
"color": "#303445",
"italic": false,
"font_size": "14",
"underline": false
},
"border_radius": "10",
"contentOptions": {
"bold": false,
"align": "left",
"color": "#454B63",
"italic": false,
"font_size": "14",
"underline": false
},
"background_color": "#FFFFFF",
"show_author_name": true,
"user_card_version": "standard",
"show_author_avatar": false,
"show_verified_badge": true
},
"date_format": "D/M/Y",
"rc_branding": true,
"schema_active": 1,
"layout_details": {
"full_width": true,
"autorotation": true,
"columns_count": 3,
"columns_space": "32",
"display_arrows": true,
"autorotation_time": 5000,
"background_color": "#FFFFFF",
"border_width": 1,
"border_color": "#DBE0F1"
},
"omnibus_setting": {
"active": 0,
"link_setting": {
"active": false,
"url": null
}
}
},
"active": true,
"type": "v3",
"name": "Profile widget test",
"excluded_platforms": null,
"created_at": "2023-05-19T10:57:50.000000Z",
"updated_at": "2023-05-19T11:40:53.000000Z",
"additional_css": null,
"chained_before_id": null,
"chained_after_id": null,
"placements": null,
"omnibus_setting": {
"active": 0,
"link_setting": {
"url": null,
"active": false
}
},
"source": 1,
"widget_id": null,
"display_count": 0,
"iframe_link": "https://api.ratingcaptain.com/widget_v3/render/100839",
"layout": {
"name": {
"en": "Carousel",
"pl": "Karuzela",
"de": "Carousel",
"it": "Carousel",
"es": "Carousel",
"cz": "Carousel",
"hu": "Carousel",
"fr": "Carousel",
"de-ch": "Carousel",
"ro": "Carousel",
"uk": "Carousel"
},
"icon": "default/widgets_v3/layouts/carousel.svg",
"uuid": "1",
"order": 1,
"component": "default",
"vueDetailsComponent": "widget-carousel-editor",
"validator": {},
"perPageService": "Modules\\Widget\\Services\\PerPageCalculations\\Carousel",
"t_name": "Carousel"
},
"style": {
"name": {
"en": "Standard",
"pl": "Standardowa",
"de": "Standard",
"it": "Standard",
"es": "Standard",
"cz": "Standard",
"hu": "Standard",
"fr": "Standard",
"de-ch": "Standard",
"ro": "Standard",
"uk": "Standard"
},
"uuid": 1,
"image_preview": "default/widgets_v3/styles/standard.png",
"t_name": "Standard"
},
"integration_code": "<div data-widget=\"100839\" ></div>\n <script src=\"https://api.ratingcaptain.com/widget_v3/js/e95d37bba10a08e47c39780da30be8de\"></script>"
}
],
"links": {
"first": "https://api.ratingcaptain.com/api/v2/widgets?page=1",
"last": "https://api.ratingcaptain.com/api/v2/widgets?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://api.ratingcaptain.com/api/v2/widgets?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://api.ratingcaptain.com/api/v2/widgets",
"per_page": 30,
"to": 10,
"total": 10
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.