Comments
Comments are short text notes in a thread with a common context.
Terminology
Section titled “Terminology”| Term | Description |
|---|---|
| thread | A group of comments. |
| context | The Sheep URI that the comments all refer to. |
| comment | The text snippet, automatically logged against the user and the current date and time. |
| key | A unique ID for the thread (to allow multiple threads to exist on the same context). |
$CONTEXT is shorthand for the URI that we are commenting about. A full URI would look like /api/v1/example/organisation/5fa523e080859e33dc285c7e/threads/.
Start a Thread
Section titled “Start a Thread”Create a new thread with no comments. A unique key for the thread is optional.
POST https://sls-api.sheepcrm.com/comments/v2/$CONTEXT/Authorization: Bearer $API_KEYContent-Type: application/json
{"title": "So I have a question..."}
HTTP/1.0 201 Created{ "bucket": "example", "data": { "context": { "display_value": "JW Travel", "ref": "/example/organisation/5fa523e080859e33dc285c7e/" }, "key": "c3c0fecd38", "thread": { "comments": [] }, "title": "So I have a question..." }, "uri": "/example/comment/603e35982e77f9de9421d470/"}Start a new thread and provide the first comment
Section titled “Start a new thread and provide the first comment”POST https://sls-api.sheepcrm.com/comments/v2/$CONTEXT/Authorization: Bearer $API_KEYContent-Type: application/json
{ "title": "So I have a question...", "comment": "Do you think these guys like us?"}View All Threads
Section titled “View All Threads”GET https://sls-api.sheepcrm.com/comments/v2/$CONTEXT/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "comments": { "37d91faf3": { "comments": [], "title": "pricing query", "uri": "/example/comment/603e326a535341676d33bb4c/" }, "8e75026d34": { "comments": [ { "comment": "Do you think these guys like us?", "datetime": "2021-03-02T13:00:21.187000", "uid": "f7d95f2939", "user": "/sheepcrm/user/5cab33e1638e5512a16d4a1f/" } ], "title": "So I have a question...", "uri": "/example/comment/603e36e52e77f9de9421d473/" } }}Delete a Thread
Section titled “Delete a Thread”DELETE https://sls-api.sheepcrm.com/comments/v2/$CONTEXT/thread/{key}/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "deleted": true}View a Specific Thread
Section titled “View a Specific Thread”GET https://sls-api.sheepcrm.com/comments/v2/$CONTEXT/thread/{key}/comment/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "thread": [ { "comment": "Do you think these guys like us?", "datetime": "2023-04-14T15:55:31.454000", "uid": "bc28e4bdf", "user": "/sheepcrm/user/.../", "user_display": "Support User" }, { "comment": "Yeah, probably!", "datetime": "2023-04-14T16:13:11.430000", "uid": "488d65d531", "user": "/sheepcrm/user/.../", "user_display": "Support User" } ], "title": "So I have a question...", "tuid": "537b52d3b4", "uri": "/example/comment/603e36e52e77f9de9421d473/"}Comment on a Thread
Section titled “Comment on a Thread”| Parameter | Description |
|---|---|
comment | Required. Text comment. |
key | Required. The thread key. |
POST https://sls-api.sheepcrm.com/comments/v2/$CONTEXT/thread/{key}/comment/Authorization: Bearer $API_KEYContent-Type: application/json
{"comment": "Why wouldn't they like us?"}
HTTP/1.0 200 OK{ "comments": { "comments": [ { "comment": "Do you think these guys like us?", "datetime": "2021-03-02T13:00:21.187000", "uid": "f7d95f2939", "user": "/sheepcrm/user/5cab33e1638e5512a16d4a1f/" }, { "comment": "Why wouldn't they like us?", "datetime": "2021-03-02T13:04:22.711633", "uid": "204f6a060d", "user": "/sheepcrm/user/5cab33e1638e5512a16d4a1f/" } ] }}Delete a Comment
Section titled “Delete a Comment”DELETE https://sls-api.sheepcrm.com/comments/v2/$CONTEXT/thread/{key}/comment/{comment-uid}/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "comments": { "comments": [ { "comment": "Why wouldn't they like us?", "datetime": "2021-03-02T13:04:22.711000", "uid": "204f6a060d", "user": "/sheepcrm/user/5cab33e1638e5512a16d4a1f/" } ] }}