API : comments
2 opérations REST du groupe comments.
GET /comments#
Notes d'une fiche (contexte utilisateur uniquement)
Notes de la fiche ciblée (exactement un de companyId/contactId/quoteId). Anté-chronologique par curseur before, servi en ordre chronologique. La fiche doit être visible. Les pièces jointes ne sont pas servies (téléchargement hors contrat bearer V1). Réservé aux sessions utilisateur (§2bis).
Scopes d'app : voir sécurité de l’opération. Les autres droits, périmètres et contrôles métier restent applicables.
Paramètres
| Nom | Emplacement | Requis | Schéma |
|---|---|---|---|
companyId | query | Non | {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"} |
contactId | query | Non | {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"} |
quoteId | query | Non | {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"} |
before | query | Non | {"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Curseur createdAt (ISO) de la page précédente","type":"string"} |
limit | query | Non | {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"integer","minimum":1,"maximum":50} |
Aucun corps de requête déclaré dans ce contrat.
Réponses
200 : Notes de la fiche
Contenu de la réponse 200
{
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"authorId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"authorName": {
"type": "string"
},
"authorAvatar": {
"type": [
"string",
"null"
]
},
"body": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"authorId",
"authorName",
"authorAvatar",
"body",
"createdAt"
],
"additionalProperties": false
}
},
"nextBefore": {
"type": [
"string",
"null"
]
}
},
"required": [
"data",
"nextBefore"
],
"additionalProperties": false
}
}
}default : Erreur - enveloppe problem+json (RFC 9457)
Contenu de la réponse default
{
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
}Opération OpenAPI complète
{
"summary": "Notes d'une fiche (contexte utilisateur uniquement)",
"description": "Notes de la fiche ciblée (exactement un de companyId/contactId/quoteId). Anté-chronologique par curseur `before`, servi en ordre chronologique. La fiche doit être visible. Les pièces jointes ne sont pas servies (téléchargement hors contrat bearer V1). Réservé aux sessions utilisateur (§2bis).",
"tags": [
"mobile"
],
"parameters": [
{
"name": "companyId",
"in": "query",
"required": false,
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
{
"name": "contactId",
"in": "query",
"required": false,
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
{
"name": "quoteId",
"in": "query",
"required": false,
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
{
"name": "before",
"in": "query",
"required": false,
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Curseur createdAt (ISO) de la page précédente",
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "integer",
"minimum": 1,
"maximum": 50
}
}
],
"security": [
{
"oauth2": []
},
{
"userSession": []
}
],
"responses": {
"200": {
"description": "Notes de la fiche",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"authorId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"authorName": {
"type": "string"
},
"authorAvatar": {
"type": [
"string",
"null"
]
},
"body": {
"type": "string"
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"authorId",
"authorName",
"authorAvatar",
"body",
"createdAt"
],
"additionalProperties": false
}
},
"nextBefore": {
"type": [
"string",
"null"
]
}
},
"required": [
"data",
"nextBefore"
],
"additionalProperties": false
}
}
}
},
"default": {
"description": "Erreur - enveloppe problem+json (RFC 9457)",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
}
}
}
}POST /comments#
Créer une note sur une fiche (contexte utilisateur uniquement)
Scopes d'app : voir sécurité de l’opération. Les autres droits, périmètres et contrôles métier restent applicables.
Corps de requête
application/json
| Champ | Type | Obligatoire | Description |
|---|---|---|---|
companyId | string | Non | |
contactId | string | Non | |
quoteId | string | Non | |
body | string | Oui |
Schéma complet du corps
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"companyId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"contactId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"quoteId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 5000
}
},
"required": [
"body"
]
}Réponses
201 : Note créée
Contenu de la réponse 201
{
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
}default : Erreur - enveloppe problem+json (RFC 9457)
Contenu de la réponse default
{
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
}Opération OpenAPI complète
{
"summary": "Créer une note sur une fiche (contexte utilisateur uniquement)",
"tags": [
"mobile"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"companyId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"contactId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"quoteId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 5000
}
},
"required": [
"body"
]
}
}
}
},
"security": [
{
"oauth2": []
},
{
"userSession": []
}
],
"responses": {
"201": {
"description": "Note créée",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
}
},
"default": {
"description": "Erreur - enveloppe problem+json (RFC 9457)",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
}
}
}
}