Journal
POST
/api/v2/journalcrm-service- curl
- JavaScript
- Python
- R
curl -s https://crm-service.scenid.cloud/api/v2/journal \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"humanIds": ["SC-ZW2VEG"],
"entry": { "channel": "PHONE", "direction": "INCOMING", "text": "Customer called about order ORD-1012." }
}'
const response = await fetch('https://crm-service.scenid.cloud/api/v2/journal', {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
humanIds: ['SC-ZW2VEG'],
entry: {
channel: 'PHONE',
direction: 'INCOMING',
text: 'Customer called about order ORD-1012.'
}
})
})
console.log(response.status, await response.json())
import requests
response = requests.post(
"https://crm-service.scenid.cloud/api/v2/journal",
headers={"Authorization": f"Bearer {token}"},
json={
"humanIds": ["SC-ZW2VEG"],
"entry": {
"channel": "PHONE",
"direction": "INCOMING",
"text": "Customer called about order ORD-1012.",
},
},
)
print(response.status_code, response.json())
library(httr2)
response <- request("https://crm-service.scenid.cloud/api/v2/journal") |>
req_auth_bearer_token(token) |>
req_body_json(list(
humanIds = list("SC-ZW2VEG"),
entry = list(
channel = "PHONE",
direction = "INCOMING",
text = "Customer called about order ORD-1012."
)
)) |>
req_error(is_error = \(r) FALSE) |>
req_perform()
resp_status(response)
resp_body_json(response)
| Body | Description |
|---|---|
humanIds | Non-empty array of entity humanIds |
entry.channel | NOTE, PHONE, MOBILE, FAX, EMAIL, CONVERSATION, CALENDAR_EVENT, FILE, JIRA, MAIL |
entry.text | Required |
entry.direction | UNKNOWN, INCOMING, OUTGOING. Only for PHONE, MOBILE, FAX, EMAIL, MAIL |
Response 201: array of the created journal documents. Author SYSTEM for service tokens, otherwise the user's display name and avatar.
Errors: journal/missing-humanIds, journal/invalid-channel, journal/missing-text, journal/direction-not-supported, journal/invalid-direction, entity/not-found.