API description
This page describes everything you need to know to create external activities in ahead.
Authorization - how to get & use API KeysLearn how to authorize your requests by using API Keys
External activities
Section titled “External activities”External activities (or simply activities) are basic snippets of information that are sent to a ahead via a POST request.
Fields
Section titled “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", "expires": "5d"}| 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 | |
| expires | The number of days in which the activity will expire. Format (\d{1,2})d. Allowed values: 0 to 30. |
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
Section titled “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/swaggerPlease note that you need to use an API Key also for this call.

