{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Custom events in the prospect activity feed - Development Portal | Outreach","description":"Outreach extensibility development and documentation portal","siteUrl":"https://developers.outreach.io","keywords":"outreach developer portal, api documentation, api reference docs, sdk documentation","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"custom-events-in-the-prospect-activity-feed","__idx":0},"children":["Custom events in the prospect activity feed"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you are aware of interesting events happening to Outreach prospects you can send custom events to indicate"," ","these changes inside prospect activity feed."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/prospect-custom-event.1502521ad3ee75f385e8af79cf42bf08528e95f3f50d3451843e9922ea494e0f.9c1bb791.png","alt":"Custom events in prospect activity feed"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuring-extension","__idx":1},"children":["Configuring extension"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the \"Activity feed custom events\" feature to your app, then configure one or more custom events."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/activity-feed-custom-events.35e5de96ddf4f015aa833812ed2150f2ea9a1e4f472a172b202f55ff517233fb.9c1bb791.png","alt":"Prospect events extension"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The event name and template will be displayed in the activity feed."," ","In the payload you can additionally send accompanying text that will also appear in the event card (see below)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/prospect-events-extension-event.8366688c06a24278bea720c8e4a3502e15cf331ada9fb882c7579961c002e699.9c1bb791.png","alt":"Prospect event configuration","title":"#width=500px;"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sending-events","__idx":2},"children":["Sending events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once you have configured your event extension, call the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["events"]}," endpoint with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api/s2s-access/#calling-the-api-through-s2s"},"children":["S2S token"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"curl https://api.outreach.io/api/v2/events \\\n  -X POST \\\n  -H \"Authorization: Bearer S2S_TOKEN\" \\\n  -d DATA\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DATA"]}," is the event data in JSON format as below:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"type\": \"event\",\n    \"attributes\": {\n      \"name\": \"my-app:my-event\",\n      \"externalUrl\": \"https://my-app.com/messages/123\",\n      \"body\": \"Hey there, this text will appear in the event card.\"\n    },\n    \"relationships\": {\n      \"prospect\": {\n        \"data\": {\n          \"type\": \"prospect\",\n          \"id\": \"PROSPECT_ID\"\n        }\n      }\n    }\n  }\n}\n\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The fields in the payload have the following meaning:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," - corresponds to the configured event id (in a form of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<app identifier>:<event id>"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["externalUrl"]}," - the target URL of the event card"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["body"]}," - a text string to appear in the card."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROSPECT_ID"]}," - Outreach prospect id that this event should be associated with."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The event card will also contain the template string you have configured for the event. In the template string you can"," ","use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{prospect}}"]}," placeholder which Outreach will replace with a link to the prospect."]}]},"headings":[{"value":"Custom events in the prospect activity feed","id":"custom-events-in-the-prospect-activity-feed","depth":1},{"value":"Configuring extension","id":"configuring-extension","depth":2},{"value":"Sending events","id":"sending-events","depth":2}],"frontmatter":{"seo":{"title":"Custom events in the prospect activity feed - Development Portal | Outreach"}},"lastModified":"2024-01-31T00:43:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/client-extensions/activity-feed-custom-events","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}