API description
This page describes everything you need to know to create external activities in ahead.
Authorization - how to get & use API Keys Learn how to authorize your requests by using API Keys
External activities
External activities (or simply activities) are basic snippets of information that are sent to a ahead via a POST request.
Fields
The basic payload of an activity would look something like this:
{ "source": "Weather", "title": "Weather in BCN", "text": "Sunny with 23 degrees.", "origin": "weather.com" "mediaurl": "http://cdn.io/bcn.jpg", "url": "http://weather.com/locations/bcn", "targetAudience": "All", "identifier": "weather-bcn"}
Field Name | Required | Example String |
---|---|---|
title | yes | The title of the activity |
source | A source that controls the icon shown on ahead. See below for possible options | |
text | The text of the activity | |
origin | Additional information that whe present, is displayed underneath the main text as if “origin” authored the activity (By {origin}) | |
mediaurl | An image that is shown below title and text | |
url | A url that is navigated to when clicked on the activity | |
targetAudience | This is relevant when using targeted activities. See our help article for more on that | |
identifier | identifier to be used to ensure that only the newest activity with this identifier ever exists. Weather or Stock Ticker activities are nice examples where to use it |
For the Source field you can use one of
- Ahead
- Birthday
- DynamicsCrm
- Event
- HubSpot
- HR
- Menuplan
- MicrosoftStream
- Pipedrive
- PressRelease
- Slack
- Sport
- Stocks
- Travel
- Weather
- X
- Yammer
- Youtube
- Other
Swagger
You can also obtain a swagger file for tools that can generate an API call from the information provided there at
https://connect.aheadintranet.com/api/ReceiveExternalActivity/swagger
Please note that you need to use an API Key also for this call.