Adding a note to an entity
Contents
Overview
- Call name: add-note
- Endpoint URL: https://api0.spaaza.com/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:
Parameter | Description |
---|---|
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
Code | HTTP Status | Description |
---|---|---|
missing_parameters | 400 | Required parameters are missing from the request. |
invalid_parameter | 400 | The model_class parameter must be User or Campaign. |
object_not_found | 404 | The specified entity could not be found. |
saving_object_error | 500 | There was an error saving the note to the database. |