Skip to main content

Adding notes

Adding a note to an entity

Contents

Overview

  • Call name: add-note
  • Endpoint URL: https://{API hostname}/internal/add-note
  • Request methods: POST
  • 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 adds a new note to an entity. Currently, notes can only be added to 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 write access for the entity to which the note is being added.
  • Privileged authentication: the use of privileged authentication is permitted for this endpoint.

Request Parameters

The following parameters can be passed to the API:

ParameterDescription
model_class(string, mandatory) The class of the entity. Must be either "User" or "Campaign".
model_id(integer, mandatory) The ID of the entity to which the note is being added.
text(string, mandatory, max=1000) The text content of the note.

Response Format

A successful response will return a JSON object containing the details of the note that was created:

{
"id": 12345,
"text": "Customer very happy with her latest purchase.",
"created_date": "2025-04-18T10:15:30Z",
"model_class": "User",
"model_id": 67890,
"creating_user": {
"user_id": 54321,
"name": "John Doe"
}
}

Possible error responses

CodeHTTP StatusDescription
missing_parameters400Required parameters are missing from the request.
invalid_parameter400The model_class parameter must be User or Campaign.
object_not_found404The specified entity could not be found.
saving_object_error500There was an error saving the note to the database.