Skip to content

API description

This page describes everything you need to know to create external activities in ahead.

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 NameRequiredExample String
titleyesThe title of the activity
sourceA source that controls the icon shown on ahead. See below for possible options
textThe text of the activity
originAdditional information that whe present, is displayed underneath the main text as if “origin” authored the activity (By {origin})
mediaurlAn image that is shown below title and text
urlA url that is navigated to when clicked on the activity
targetAudienceThis is relevant when using targeted activities. See our help article for more on that
identifieridentifier 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
  • Facebook
  • HubSpot
  • HR
  • Instagram
  • Menuplan
  • MicrosoftStream
  • Pipedrive
  • PressRelease
  • Slack
  • Sport
  • Stocks
  • Travel
  • Twitter
  • 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.