Restricted messages on a timeline
Introduction
In this tutorial, you’ll learn how to send restricted visibility messages on the timeline of an object by using the timeline-entries-create
API. These messages are only visible to the specific users you give access to.
The timeline entries API is used to create discussions (comments) on the timeline of an object such as a ticket or issue. These messages can be sent by users or by a bot. You can use this to send any information about a customer like their last logged in date and time, the last page they visited, or an error they encountered.
Send a restricted visibility message
To send a restricted visibility message, follow the steps listed below:
The payload to make a request would look like given below:
object
must be of type string and contains<partition>
,<dev-org-id>
, and<object-id>
.body
is of type string and contains the actual message to be posted.visibility
is set toprivate
in order for the message to be visible only to users,internal
is visible with the Dev organization,external
is visible to the Dev organzation and customers, andpublic
is visible to all.type
should betimeline_comment
.
- Get the object ID and object type where you want to send a message.
Example: In issue
ISS-69
,69
is the object ID andISS
indicates the object typeissue
.
-
Get the
dev-org-id
andpartition
by making a call to thedev-users.self
API. -
Get the display IDs of the users you want to send the private message to. Add these display IDs in the
private_to
array.
Example:
DEVU-1
- Make a POST request to (“https://api.devrev.ai/timeline-entries.create”) and include the PAT created in the authorization header of the request along with the payload with replaced IDs.
In this example, you are using curl to make the requests but you can use any tool you prefer.
You receive the following json
response.
You can check the object to which you sent a message in the UI. It’s visible to the creator and the users you added in private_to
.
Summary
In this tutorial, you learned how to post a comment on the timeline of an issue/ticket using the timeline-entries.create
API with different visibilities. You can now use this to create comments on timeline using automation or manually based on your use case.