This documentation provides details on how to use the Intensify Digital API via Curl to fetch sent messages from campaigns. The API allows retrieval of scheduled messages, including media and metadata, for display in various application formats such as social feeds, multimedia apps (i.e. images, videos, musics), TV-style streaming, or eLearning courses.
The primary endpoint fetches sent messages for a specific campaign. It requires authentication via a Bearer token.
GET https://portal.intensifydigital.com/api/campaign/{campaignId}/messages/sent
campaignId
: The ID of the campaign (required, integer).Authorization: Bearer {your_token}
(required).Content-Type: application/json
(optional for GET).message
, scheduled_at
, media
(array with location
, thumbnail
, mime_type
), etc.Replace {campaignId}
and {bearerToken}
with your actual values.
curl -X GET \
"https://portal.intensifydigital.com/api/campaign/{campaignId}/messages/sent?page=1&limit=10&order=asc" \
-H "Authorization: Bearer {bearerToken}" \
-H "Content-Type: application/json"
Available URL request parameters:
Parameter | Sample Value | Description |
---|---|---|
|
|
An |
|
|
An |
|
|
A |
Below are three PHP-based examples demonstrating how to integrate the API into different application styles. Each example fetches data from the API, processes it (e.g., sorting by date, generating slugs), and renders it in a user-friendly interface with dark/light theme support, modals for previews, pagination, and responsive design. Click "View Code" to see the full code in a modal for copy-pasting, or "Download Code" to download the file.
This demo creates a vertical feed resembling a social media app, focused on a single campaign created with Intensify Digital. Campaign is Intensify Digital's system term for a structured content feed, but it can also be used synonymously with channel or social feed. It uses cURL to fetch sent messages from the API endpoint https://portal.intensifydigital.com/api/campaign/{campaignId}/messages/sent
. The JSON response is decoded, sorted by the scheduled_at
field in descending order (newest first), and unique slugs are generated for each message based on its content for permalinks. If a ?post=slug
query parameter is present in the URL, the script renders a single post view displaying the full message text, associated media (image or video with controls), a page title derived from the message (truncated to 60 characters), a theme toggle button (dark/light mode persisted via localStorage), and a back link to the main feed. In the default feed view, it presents a vertical column of tiles, each showing a thumbnail (or a placeholder if no media is available), a truncated message (50 characters), and the scheduled date converted from UTC to the user's local timezone using JavaScript. Clicking a tile opens a modal with fade-in/out transitions, a loading spinner, full media display (supporting both images and videos), the message as a clickable hyperlink to the single post view, and navigation arrows for previous/next messages within the same campaign. The modal also supports touch swipe gestures for navigation (left for next, right for previous). A theme toggle button allows switching between dark and light modes, with the preference saved in localStorage. Error handling includes checking for cURL errors and JSON decoding issues, displaying error messages or skipping faulty campaigns. The design is responsive, with tile sizes and layouts adjusting for smaller screens (e.g., increasing image height to 250px on screens <480px).
This demo emulates a streaming TV interface, supporting multiple campaigns. Campaign is Intensify Digital's system term for a structured content feed, but it can also be used synonymously with channel, chapter, or shows. It uses cURL to fetch messages for each campaign from the API, decodes the JSON response, sorts messages by scheduled_at
(newest first), and generates slugs. The single post view is identical to the first example, showing the full message, media, theme toggle, and back link. The default feed view organizes messages into horizontal scrolling rows (one per campaign) in a Netflix-style layout, with smooth scrolling enabled by drag momentum on desktop (using mouse events with velocity and friction for a natural feel) and touch scrolling on mobile. Each tile displays a thumbnail (or placeholder), a truncated message, and the scheduled date in local time. Clicking a tile opens a modal with fade transitions, a loading spinner, full media display, a message linked to the single post view, and navigation arrows/swipes for browsing messages within the campaign. Touch swipe gestures are supported in the modal. The theme toggle persists dark/light modes via localStorage. The scrolling mechanism includes advanced JavaScript for momentum-based scrolling, where the row continues moving slightly after the user stops dragging, slowing down with friction. The design is responsive, with tile sizes shrinking (e.g., 200px width, 120px height on screens <480px) for smaller devices. Error handling displays cURL or JSON errors as messages on the page.
This demo implements an eLearning-style interface with a collapsible sidebar for navigating multiple campaigns. Campaign is Intensify Digital's system term for a structured content feed, but it can also be used synonymously with course, chapter, or exercises. It fetches messages via cURL, decodes JSON, sorts by date, and generates slugs, with robust error handling for HTTP status codes (e.g., non-200 responses) and JSON errors, storing errors in the campaignsData
array for display. The single post view mirrors the others. The main view features a fixed sidebar with accordions (<details>
elements) for each campaign, listing messages with thumbnails or placeholders and clickable titles. Clicking a sidebar item loads the message in a central pane with full media (image or video), fade transitions, a loading spinner, a message linked to the single post view, and navigation arrows/swipes. The script persists the last viewed campaign and message index in localStorage, automatically loading them on page load for continuity. The sidebar can be toggled to collapse, expanding the main content area to full-screen, especially useful on mobile devices, with a toggle button that adjusts position based on screen size (150px for <480px, 200px for <768px, 250px otherwise). Navigation arrows in the main pane fade out after 2 seconds of inactivity on desktop but reappear on mouse movement. Touch swipes are supported for navigation. The theme toggle persists dark/light modes. The layout is responsive, adjusting sidebar width and tile sizes for smaller screens. Errors are displayed if the API response is invalid or empty.