---
name: hootsuite-core-workflow-b-59cd6966fdbc
description: 'Execute Hootsuite secondary workflow: Core Workflow B.

  Use when implementing secondary use case,

  or complementing primary workflow.

  Trigger with phrases like "hootsuite secondary workflow",

  "secondary task with hootsuite".

  '
allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(curl:*), Grep
version: 1.6.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags:
- saas
- hootsuite
- social-media
- analytics
compatibility: Designed for Claude Code
---
# Hootsuite Analytics & URL Shortening

## Overview

Retrieve social media analytics and use Ow.ly URL shortening via the Hootsuite API. Track post performance, engagement metrics, and click-through rates.

## Prerequisites

- Completed `hootsuite-install-auth` setup
- Published posts with engagement data

## Instructions

### Step 1: Get Organization Analytics

```typescript
import 'dotenv/config';
const TOKEN = process.env.HOOTSUITE_ACCESS_TOKEN!;
const BASE = 'https://platform.hootsuite.com/v1';

async function getOrganization() {
  const response = await fetch(`${BASE}/me/organizations`, {
    headers: { 'Authorization': `Bearer ${TOKEN}` },
  });
  const { data } = await response.json();
  return data[0]; // Primary organization
}
```

### Step 2: Shorten URLs with Ow.ly

```typescript
async function shortenUrl(fullUrl: string) {
  const response = await fetch(`${BASE}/shorteners/owly`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ url: fullUrl }),
  });
  const { data } = await response.json();
  console.log(`${fullUrl} → ${data.shortUrl}`);
  return data;
}

// Shorten multiple URLs
async function shortenBatch(urls: string[]) {
  return Promise.all(urls.map(url => shortenUrl(url)));
}
```

### Step 3: Retrieve Message Analytics

```typescript
async function getMessageAnalytics(messageId: string) {
  const response = await fetch(`${BASE}/messages/${messageId}`, {
    headers: { 'Authorization': `Bearer ${TOKEN}` },
  });
  const { data } = await response.json();
  console.log(`Message: ${data.text?.substring(0, 50)}...`);
  console.log(`State: ${data.state}`);
  console.log(`Sent: ${data.sentAt}`);
  return data;
}

// List sent messages and their performance
async function getSentMessages(profileId: string) {
  const response = await fetch(
    `${BASE}/messages?socialProfileIds=${profileId}&state=SENT&limit=20`,
    { headers: { 'Authorization': `Bearer ${TOKEN}` } },
  );
  const { data } = await response.json();
  for (const msg of data) {
    console.log(`[${msg.sentAt}] ${msg.text?.substring(0, 60)}`);
  }
  return data;
}
```

### Step 4: Social Profile Metrics

```typescript
async function getProfileDetails(profileId: string) {
  const response = await fetch(`${BASE}/socialProfiles/${profileId}`, {
    headers: { 'Authorization': `Bearer ${TOKEN}` },
  });
  const { data } = await response.json();
  console.log(`Profile: @${data.socialNetworkUsername}`);
  console.log(`Network: ${data.type}`);
  console.log(`ID: ${data.id}`);
  return data;
}
```

## Output

- Organization analytics retrieved
- URLs shortened via Ow.ly
- Message performance data
- Social profile metrics

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| `404` on message | Message deleted or wrong ID | Verify message ID |
| No analytics data | Post too recent | Wait for engagement data (24-48h) |
| Ow.ly rate limited | Too many shortening requests | Batch and throttle |

## Examples

For a draft workflow, record `profile=sandbox-brand; action=queue-draft; approval=pending; audience=test-only; idempotency=once; public_posts=0; rollback=workflow-r6` rather than preserving post copy or media.

## Resources

- [Hootsuite API Reference](https://apidocs.hootsuite.com/docs/api/index.html)
- [URL Shortening](https://developer.hootsuite.com/docs/api-overview)
- [Analytics Guide](https://help.hootsuite.com/hc/en-us/articles/1260804306749)

## Next Steps

For common errors, see `hootsuite-common-errors`.


---
Source attribution: jeremylongshore
Original project: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/ab85a061f7bcc039dac13ee193de7a4cd4388571/plugins/saas-packs/hootsuite-pack/skills/hootsuite-core-workflow-b/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2025 Jeremy Longshore

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: jeremylongshore
Original project: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/ab85a061f7bcc039dac13ee193de7a4cd4388571/plugins/saas-packs/hootsuite-pack/skills/hootsuite-core-workflow-b/SKILL.md
Attribution basis: Source repository record

Fields of work: Marketing
Roles: Content Marketer, Marketing Analyst, Social Media Manager
Specialties: API
Tools: Hootsuite
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: c311256803a25336151e1ef01057ab2141932989e996891dbb9059b5d3d385eb
