Link Search Menu Expand Document

Deleting notes from an entity

Contents

Overview

  • Call name: delete-note
  • Endpoint URL: https://api0.spaaza.com/internal/delete-note
  • Request methods: DELETE
  • Request Content-Type: application/json or application/x-www-form-urlencoded
  • Response Content-Type: application/json
  • Auth required: yes
  • X-Spaaza-MyPrice-App-Hostname header requirement: mandatory when using privileged authentication

This API call deletes notes from an entity. You can delete a specific note by its ID or all notes for a specific entity. Currently, notes are only supported for User and Campaign entities.

Permissions and Authentication

This API call requires a valid Spaaza session. The session can be as follows:

  • Admin authentication: the performing user needs to be logged in and have delete access for the entity from which notes are being deleted.
  • Privileged authentication: the use of privileged authentication is permitted for this endpoint.

Request Parameters

The following parameters can be passed to the API:

Parameter Description
note_id (integer, conditional) The ID of the specific note to delete. Either note_id or both model_class and model_id must be provided.
model_class (string, conditional) The class of the entity. Must be either “User” or “Campaign”. Required if note_id is not provided.
model_id (integer, conditional) The ID of the entity for which to delete all notes. Required if note_id is not provided.

Response Format

When deleting a single note by note_id, the response will be a JSON object confirming the deletion:

{
  "deleted": true,
  "note_id": 12345
}

When deleting all notes for an entity using model_class and model_id, the response will be:

{
  "deleted": true,
  "model_class": "User",
  "model_id": 67890
}

Possible error responses

Code HTTP Status Description
invalid_parameters 400 Either note_id or both model_class and model_id are required.
object_not_found 404 The specified note could not be found.
saving_object_error 500 There was an error during database operation.