Skip to main content
Version: 25.03

Star Rating - Remove Widget

Endpoint​

/i/feedback/widgets/remove

Overview​

Removes a star-rating widget, and optionally the feedback it collected.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

Requires star_rating Delete permission.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringYesApp ID the widget belongs to.
widget_idStringYesTarget widget ID.
with_dataBooleanNoWhen set, the feedback submitted for this widget is deleted as well.

Examples​

Remove a widget and its feedback​

/i/feedback/widgets/remove?
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
widget_id=67a3d2f5c1a23b0f4d6c0201&
with_data=true

Response​

Success Response​

{
"result": "Success"
}

Response Fields​

FieldTypeDescription
resultStringSuccess when the widget was removed.

Error Responses​

  • 400
{
"result": "Invalid widget id."
}
  • 404
{
"result": "Widget not found"
}
  • 500: the database error message, if the removal failed.

Standard authentication/authorization errors from delete validation can also be returned.

Behavior​

  • Converts widget_id to an ObjectID and looks the widget up within the given app.
  • Deletes the widget document.
  • If the widget has a targeting cohort and the Cohorts plugin is enabled, deletes that cohort.
  • With with_data, also deletes the widget's entries from the app's feedback collection and writes a feedback_widget_removed_with_data system log entry. Otherwise it writes feedback_widget_removed.

Impact on Other Data​

  • Removes one widget from countly.feedback_widgets.
  • With with_data, removes the widget's submissions from countly.feedback{appId}.
  • May delete a related cohort from countly.cohorts.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.feedback_widgetsWidget storageReads and deletes the widget document.
countly.feedback{appId}Feedback submissionsDeleted for the widget when with_data is set.
countly.cohortsTargeting cohortsMay delete the widget's cohort (when cohorts plugin enabled).
countly.systemlogsAudit trailReceives feedback_widget_removed or feedback_widget_removed_with_data.