Commentaire
Création de commentaire
La gestion des commentaires peut se faire sur différentes entités:
- Organisation, c'est le cas du Carnet de laison
- Taches (Task), commenter une tache d'organisation
- Fil de discussion (Topic), un répondre a une sujet sur un espace de discussion
- Bon plan (Deal), commenter un bon plan
- Demande de devis/contact (Lead), commenter une demande de rappel devis
basePath: /api/v0/organisations/:organisation_id/postable/:postable_id/posts
url params
- :organisation_id (integer, required): Identifiant de l'organisation parente au post
- :postable_id (integer, required): Identifiant du contenu (Task/Topic/Deal/Lead) sur lequel on crée un commentaire
body params
- :post.postable_type (enum: (Organisation, Tasks::Family, Tasks::Association, Topic, Deal, Leads::Qualified, Leads::NonQualified), required): Nature du contenu posté
- :post.raw (string, required): Contenu brut du post
- :post.restrictions (json, required): JSON contenant les cercles & leurs visibilité du post
- :post.file (blob, optional): un fichier associé au message
curl:
curl -H "Authorization: Bearer 9e7de626-5c23-46a7-a90d-cb1d8a9b57ab" \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-X POST \
-d '{"post": {"postable_type":"Topic", "raw":"hello"}}' \
https://twigy-server-staging.herokuapp.com/api/v0/organisations/166/postable/37/posts
reponse
{
"post": {
"created_at": "2018-11-09T08:07:41.425Z",
"helper": {
"avatar_url": "https://wello-avatars-staging.s3.eu-west-1.amazonaws.com/fbd6710b-cbbc-44a0-a51b-10f6d9aa95b6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3UHEOMIB2X7AY3A%2F20181109%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20181109T080741Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=10fadc8951d031d9d46906dc516242c7894a3e8c452b1725c1915ecb81f8bb0b",
"first_name": "Sophie",
"id": 379,
"last_name": "Finot",
"username": null
},
"id": 206,
"raw": "hello"
}
}