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"
}
}
This endpoint creates a new feedback record.
Webhooks
Feedback can be sent to a defined webhook. Go to 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",
"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",
}
}
}