Feedback
REST API
API domain: api.productfruits.com
Create a new feedback record
Resource: POST /v1/feedback
Body
{
"username": "username.of.the.user", // REQUIRED
"text": "Text of the feedback", // REQUIRED
"environmentInfo": {
"userAgent": "Identification string of user's device. Will be listed in the UI"
}
}This endpoint creates a new feedback record.
Webhooks
Feedback can be sent to a defined webhook. Go to User feedback -> Feedback widget -> Notifications to enable the webhook integration. This integration doesn't need any API key. We will include the pfruits_security_token query parameter in the webhook URL that will hold a secret token. This token will be generated once you save the webhook URL in the administration.
The webhook payload will consist of the following properties:
{
"type": "webhook:newfeedback",
"data": {
"projectCode": "the code of your workspace",
"text": "text of the feedback",
"category": {
"id": "category ID",
"name": "category name"
},
"authorName": "John Smith",
"authorEmail": "john@email.com",
"authorUsername": "john.smith",
"screenshotsUrls": ['url1', 'url2'],
"videoDataUrls": ['url1', 'url2'],
"createdAt": "2022-08-12T20:55:18",
/* Values of the following properties are gathered from the browser */
"environmentInfo": {
"url": window.location.href,
"viewportWidth": window.innerWidth,
"viewportHeight": window.innerHeight,
"appCodeName": navigator.appCodeName,
"appName": navigator.appName,
"appVersion": navigator.appVersion,
"cookieEnabled": navigator.cookieEnabled,
"deviceMemory": navigator.deviceMemory,
"doNotTrack": navigator.doNotTrack,
"hardwareConcurrency": navigator.hardwareConcurrency,
"language": navigator.language,
"maxTouchPoints": navigator.maxTouchPoints,
"onLine": navigator.onLine,
"platform": navigator.platform,
"product": navigator.product,
"productSub": navigator.productSub,
"userAgent": navigator.userAgent,
"vendor": navigator.vendor,
"vendorSub": navigator.vendorSub
},
"authorProps": {
"customProperty1": "custom property value1",
"customProperty2": "custom property value2",
"customProperty3": "custom property value3",
}
}
}Where the Values Come From
authorUsername– theusernameyou pass when identifying the user.authorNameandauthorEmail– only filled in if you pass the user’s name andemailwhen identifying them.authorProps– the custom properties you pass in the user information object. If you need a value in the webhook, such as a customer ID or plan, send it as a custom property.category– only included when the Categories field is configured.environmentInfo– collected from the user’s browser when the feedback is submitted.