Back to Social & Digital Promotion

Integration and API Spec

The reference during the build: every tool connection, field mapping, error scenario, and change-control rule.

4 pagesPDF · Technical
FS-DOC-05Technical

Integration and API Spec

Social and Digital Promotion Automation

Document code
FS-DOC-05
Process
Social and Digital Promotion
Audience
Developer
Date
[Today's Date]
Client
[YourCompany.com]
Build option
Standard (recommended)

01Tool inventory

The table below lists every tool that participates in the automation, its role in the process, how it authenticates, the minimum plan required, and which agent or component consumes it.

Tool
Role
Auth method
Min plan
Used by
FullSpec Automation
Orchestration, workflow logic, and monitoring
API key (bearer token)
Standard ($135/month)
All agents; core orchestration layer
Buffer
Scheduling and publishing posts to social channels
OAuth 2.0 (Authorization Code)
Essentials ($15/month)
Scheduling Agent
Google Analytics
Pulling channel performance metrics for reporting
OAuth 2.0 (Service Account or Authorization Code)
Free (GA4 standard)
Reporting Agent
Canva
Generating and resizing channel-ready creative assets
OAuth 2.0 (Authorization Code)
Canva for Teams or higher
Channel Formatting Agent
Slack
Distributing the compiled weekly performance report to team
OAuth 2.0 (Bot Token, scopes-based)
Free tier or above
Reporting Agent (output step)
Google Sheets
Intermediate data store for report compilation (optional fallback)
OAuth 2.0 (Service Account or Authorization Code)
Free (Google Workspace or personal)
Reporting Agent (staging store)
Google Sheets is used by the Reporting Agent as an optional staging layer when a persistent tabular record of metrics is required alongside the Slack report. It is not mandatory if FullSpec Automation's internal data store is used instead.

02Per-tool integration detail

FullSpec Automation

Primary orchestration platform. All agents run inside FullSpec Automation workflows. Credentials for downstream tools are stored in its encrypted credential store and injected at runtime. Webhooks and polling nodes are configured here to trigger agents.

Auth method
Bearer token passed in Authorization header on every outbound API call to external services; inbound webhook endpoints protected by shared HMAC secret.
Scopes / permissions
Full workflow execution; credential read/write (admin role required during setup); webhook registration.
Base URL
https://api.fullspec.io/v1
Key config
FULLSPEC_API_KEY stored as encrypted env var; webhook signing secret FULLSPEC_WEBHOOK_SECRET set at workspace level.
Rate limits
Standard plan: 1,000 workflow executions/day; 100 API calls/minute per workspace. Retry budget: 3 attempts with exponential backoff (2s, 4s, 8s).
Constraints
Workflow timeout is 300 seconds per execution. Large image payloads from Canva must be streamed via URL reference, not base64-encoded inline, to stay within the 10 MB payload limit.
// Inbound trigger payload (content approved webhook)
{
  "event": "content.approved",
  "post_id": "<uuid>",
  "approved_by": "<user_email>",
  "channels": ["instagram", "linkedin", "facebook"],
  "asset_url": "https://cdn.canva.com/...",
  "caption_draft": "<string>",
  "approved_at": "<ISO8601>"
}
// Outbound: workflow execution status
{
  "execution_id": "<uuid>",
  "status": "running | success | error",
  "started_at": "<ISO8601>"
}
Buffer

Handles scheduling and publishing of formatted posts to each connected social channel. The Scheduling Agent calls Buffer's API to create scheduled updates and then polls for publish confirmation.

Auth method
OAuth 2.0 Authorization Code flow. Access token and refresh token stored in FullSpec credential store. Token refresh is automatic on 401 response.
Scopes
profile:read, updates:write, updates:publish, analytics:read (required for publish confirmation status).
Base URL
https://api.bufferapp.com/1
Key endpoints
POST /updates/create.json (schedule a post); GET /updates/{id}.json (check publish status); GET /profiles.json (list connected channels and profile IDs).
Rate limits
Essentials plan: 30 requests/minute per access token. Posts are batched per execution; a sleep node of 2 seconds between sequential scheduling calls is required to stay within limits.
Constraints
Buffer requires a separate profile_id per channel. Profile IDs must be retrieved at setup and stored as workflow constants. Media attachments must be provided as public HTTPS URLs; direct file upload is not supported on the Essentials plan. Scheduled time must be in Unix timestamp format (UTC).
// Input: create scheduled update
POST /1/updates/create.json
{
  "profile_ids[]": "<buffer_profile_id>",
  "text": "<formatted_caption>",
  "media[photo]": "<public_image_url>",
  "scheduled_at": <unix_timestamp_utc>,
  "shorten": true
}
// Output: scheduled update confirmation
{
  "success": true,
  "updates": [{
    "id": "<update_id>",
    "status": "buffer",
    "scheduled_at": <unix_timestamp>,
    "profile_id": "<profile_id>"
  }]
}
Google Analytics (GA4)

Supplies channel performance metrics consumed by the Reporting Agent. The integration uses the GA4 Data API (runReport endpoint) with a service account to avoid per-user OAuth token expiry issues in automated flows.

Auth method
OAuth 2.0 Service Account (recommended for server-to-server). Service account JSON key stored in FullSpec credential store. Alternatively, Authorization Code flow with offline access and stored refresh token.
Scopes
https://www.googleapis.com/auth/analytics.readonly
Base URL
https://analyticsdata.googleapis.com/v1beta
Key endpoint
POST /properties/{propertyId}:runReport (fetch metrics by date range and dimension); GET /properties/{propertyId}/metadata (validate available dimensions and metrics).
Rate limits
Standard GA4 quota: 10 concurrent requests per property; 10 requests/second per project. Report requests with large date ranges count as 1 token each. Use a 1-second delay between sequential requests if pulling multiple properties.
Constraints
GA4 property ID must be confirmed at setup (format: properties/XXXXXXXXX). Data freshness latency is 24 to 48 hours for standard properties. Reporting Agent must account for this by targeting the previous full day or week, not real-time data. Session and event-scoped dimensions cannot be mixed in a single report request.
// Input: run report request
POST /v1beta/properties/XXXXXXXXX:runReport
{
  "dateRanges": [{"startDate": "7daysAgo", "endDate": "yesterday"}],
  "dimensions": [{"name": "sessionDefaultChannelGroup"}],
  "metrics": [
    {"name": "sessions"},
    {"name": "engagedSessions"},
    {"name": "screenPageViews"},
    {"name": "conversions"}
  ]
}
// Output: report rows
{
  "rows": [{
    "dimensionValues": [{"value": "Organic Social"}],
    "metricValues": [
      {"value": "1240"},
      {"value": "890"},
      {"value": "3100"},
      {"value": "42"}
    ]
  }],
  "rowCount": 1
}
Canva

Used by the Channel Formatting Agent to generate or resize creative assets to match per-channel specifications. The Canva Connect API is called to duplicate a master design, apply channel-specific dimensions, and export a publish-ready image URL.

Auth method
OAuth 2.0 Authorization Code flow. Requires Canva for Teams account. Access token stored in FullSpec credential store with automatic refresh on 401.
Scopes
design:content:read, design:content:write, design:meta:read, asset:read, asset:write, export:read.
Base URL
https://api.canva.com/rest/v1
Key endpoints
POST /designs (create design from template); POST /designs/{designId}/exports (trigger export job); GET /exports/{jobId} (poll for export completion and retrieve URL); GET /designs/{designId} (inspect design metadata).
Rate limits
Canva Connect API: 100 requests/minute per OAuth token. Export jobs are asynchronous; polling interval must be at least 3 seconds. Maximum 10 concurrent export jobs per token.
Constraints
Template design IDs must be pre-configured per channel (e.g., separate template IDs for Instagram 1:1, LinkedIn banner, Facebook post). Exported images are available via signed URL valid for 1 hour; FullSpec Automation must transfer assets to a durable store (such as S3 or Google Drive) before passing URLs to Buffer.
// Input: create channel-specific design
POST /rest/v1/designs
{
  "design_type": {"type": "preset", "name": "InstagramPost"},
  "asset_id": "<master_asset_id>"
}
// Input: trigger export
POST /rest/v1/designs/{designId}/exports
{
  "format": {"type": "jpg", "quality": 90}
}
// Output: export job result
{
  "job": {
    "id": "<job_id>",
    "status": "success",
    "urls": ["https://export.canva.com/..."]
  }
}
Slack

Receives the compiled weekly performance report as a formatted message posted by the Reporting Agent to a designated channel. Optional: attaches the Google Sheets report link or a rendered summary block.

Auth method
OAuth 2.0 Bot Token (xoxb-...). Installed via Slack App with bot scopes. Token stored in FullSpec credential store.
Scopes
chat:write, chat:write.public, files:write (if uploading report attachment), channels:read (to resolve channel ID from name).
Base URL
https://slack.com/api
Key endpoints
POST /chat.postMessage (send report message); POST /files.uploadV2 (attach report file if needed); GET /conversations.list (resolve channel name to ID at setup).
Rate limits
Tier 3: 50 requests/minute. Report posting is a single call per reporting cycle; rate limits are not a practical constraint for this use case.
Constraints
Channel ID (not name) must be stored as a workflow constant. Bot must be invited to the target channel before posting. Block Kit layout is recommended for structured report summaries; plain text fallback should be included for accessibility.
// Input: post report message
POST /api/chat.postMessage
{
  "channel": "<channel_id>",
  "text": "Weekly Social Report is ready.",
  "blocks": [
    {"type": "header", "text": {"type": "plain_text", "text": "Weekly Social Performance"}},
    {"type": "section", "fields": [
      {"type": "mrkdwn", "text": "*Sessions:* 1,240"},
      {"type": "mrkdwn", "text": "*Conversions:* 42"}
    ]}
  ]
}
// Output: message confirmation
{
  "ok": true,
  "channel": "<channel_id>",
  "ts": "<message_timestamp>"
}
Integration and API SpecPage 1 of 3
FS-DOC-05Technical

03Field mappings between tools

The following tables define field-level mappings for each agent handoff in the automation. Field names are shown in monospace. Transformation notes describe any formatting, type conversion, or conditional logic applied during the handoff.

Handoff 1: Content approval trigger to Channel Formatting Agent (FullSpec Automation webhook to Canva API)

Source tool
Source field
Destination tool
Destination field
Transform / notes
FullSpec Automation
post_id
Canva
asset_id reference
Mapped to master template lookup; post_id resolves template design ID from config map
FullSpec Automation
channels[]
Canva
design_type.name
Each channel string maps to a preset name: instagram -> InstagramPost, linkedin -> LinkedInPost, facebook -> FacebookPost
FullSpec Automation
asset_url
Canva
asset_id
Asset uploaded to Canva asset library via POST /assets if not already present; returned asset_id used
FullSpec Automation
caption_draft
Canva (metadata)
design_title
Truncated to 50 chars for design title; full caption passed separately to Scheduling Agent
FullSpec Automation
approved_at
Internal workflow
approval_timestamp
Stored as ISO8601 string; used downstream for optimal scheduling window calculation

Handoff 2: Channel Formatting Agent to Scheduling Agent (Canva export output to Buffer API)

Source tool
Source field
Destination tool
Destination field
Transform / notes
Canva
job.urls[0]
Buffer
media[photo]
Signed Canva URL transferred to durable store first; durable public URL passed to Buffer
FullSpec Automation
caption_draft
Buffer
text
Per-channel caption trimming applied: Instagram max 2,200 chars, LinkedIn max 3,000 chars, Facebook max 63,206 chars
FullSpec Automation (config)
channel_profile_map[channel]
Buffer
profile_ids[]
Static config map resolves channel name string to Buffer profile_id UUID at runtime
FullSpec Automation
approval_timestamp
Buffer
scheduled_at
Converted from ISO8601 to Unix timestamp (UTC); optimal offset added per channel (config-driven, default +2 hours)
FullSpec Automation
post_id
Buffer
source_url (custom field)
Stored as reference tag for correlation in downstream reporting

Handoff 3: Reporting Agent data collection (Google Analytics API to Slack and Google Sheets)

Source tool
Source field
Destination tool
Destination field
Transform / notes
Google Analytics
rows[].metricValues[0].value
Google Sheets
sessions
Cast from string to integer; written to column B of weekly report sheet
Google Analytics
rows[].metricValues[1].value
Google Sheets
engaged_sessions
Cast from string to integer; written to column C
Google Analytics
rows[].metricValues[2].value
Google Sheets
page_views
Cast from string to integer; written to column D
Google Analytics
rows[].metricValues[3].value
Google Sheets
conversions
Cast from string to integer; written to column E
Google Analytics
rows[].dimensionValues[0].value
Google Sheets
channel_group
String; written to column A. Filtered to Organic Social rows only
Google Sheets
spreadsheet_url
Slack
blocks[].text (mrkdwn link)
Sheet URL embedded as hyperlink in Slack Block Kit section element
Google Analytics (computed)
engagement_rate (engagedSessions/sessions)
Slack
blocks[].fields[].text
Computed as float, formatted to 1 decimal percent string before insertion into Slack block
FullSpec Automation
report_week_label
Slack
blocks[0].text.text
Header string formatted as 'Weekly Social Performance: W{week_number} {year}'

04Build stack and orchestration

The automation is orchestrated entirely within FullSpec Automation (n8n-compatible workflow engine). The table below summarises the full build stack, component responsibility, and hosting approach for the Standard build.

Layer
Component
Technology
Hosting
Notes
Orchestration
Workflow engine
FullSpec Automation (n8n-based)
FullSpec cloud (Standard plan)
All agent workflows, logic branches, and retries execute here
Trigger
Content approval webhook
Webhook node (HMAC-verified)
FullSpec cloud
Fires on content.approved event from content calendar or manual trigger
Formatting
Channel Formatting Agent
HTTP Request nodes + Canva API
FullSpec cloud
Loops over channels[], calls Canva per channel, exports and stores asset URLs
Scheduling
Scheduling Agent
HTTP Request nodes + Buffer API
FullSpec cloud
Iterates formatted posts, calls Buffer create endpoint, polls publish status
Metrics
Reporting Agent (collection)
HTTP Request node + GA4 Data API
FullSpec cloud
Scheduled weekly (cron: Monday 07:00 UTC), calls GA4 runReport
Reporting
Reporting Agent (output)
Google Sheets node + Slack node
FullSpec cloud
Writes metrics to Sheets, posts Block Kit summary to Slack
Asset store
Durable image storage
Google Drive or S3 bucket
Client-managed
Canva export URLs are short-lived; assets must be re-hosted before passing to Buffer
Monitoring
Error alerting
FullSpec Automation error workflow
FullSpec cloud
On any node failure: sends Slack alert to ops channel with execution ID and error message
Secrets
Credential store
FullSpec encrypted credential vault
FullSpec cloud
All OAuth tokens and API keys stored here; never in workflow JSON

The following code block shows the n8n-compatible credential store entries required. Each entry maps to a credential type in FullSpec Automation. These must be created in the credential manager before any workflow is activated.

n8n credential store entries (FullSpec Automation credential manager)
// Credential 1: FullSpec Automation internal API key
Name:    FULLSPEC_INTERNAL
Type:    genericCredentialType (Header Auth)
Field:   Authorization: Bearer <FULLSPEC_API_KEY>

// Credential 2: Buffer OAuth 2.0
Name:    BUFFER_OAUTH
Type:    oAuth2Api
Fields:
  clientId:         <buffer_client_id>
  clientSecret:     <buffer_client_secret>
  accessTokenUrl:   https://api.bufferapp.com/1/oauth2/token.json
  authUrl:          https://bufferapp.com/oauth2/authorize
  scope:            profile:read updates:write updates:publish analytics:read
  grantType:        authorizationCode

// Credential 3: Google Analytics (GA4) Service Account
Name:    GA4_SERVICE_ACCOUNT
Type:    googleServiceAccount
Fields:
  serviceAccountEmail:  <sa-name>@<project>.iam.gserviceaccount.com
  privateKey:           <PEM private key from JSON key file>
  scope:                https://www.googleapis.com/auth/analytics.readonly

// Credential 4: Canva OAuth 2.0
Name:    CANVA_OAUTH
Type:    oAuth2Api
Fields:
  clientId:         <canva_client_id>
  clientSecret:     <canva_client_secret>
  accessTokenUrl:   https://api.canva.com/rest/v1/oauth/token
  authUrl:          https://www.canva.com/api/oauth/authorize
  scope:            design:content:read design:content:write design:meta:read asset:read asset:write export:read
  grantType:        authorizationCode

// Credential 5: Slack Bot Token
Name:    SLACK_BOT
Type:    slackApi
Fields:
  accessToken:  xoxb-<bot_token>

// Credential 6: Google Sheets OAuth 2.0 (or Service Account)
Name:    GSHEETS_SERVICE_ACCOUNT
Type:    googleServiceAccount
Fields:
  serviceAccountEmail:  <sa-name>@<project>.iam.gserviceaccount.com
  privateKey:           <PEM private key>
  scope:                https://www.googleapis.com/auth/spreadsheets

// Workflow constants (stored as n8n environment variables)
BUFFER_PROFILE_MAP:    {"instagram": "<id>", "linkedin": "<id>", "facebook": "<id>"}
GA4_PROPERTY_ID:       properties/XXXXXXXXX
SLACK_REPORT_CHANNEL:  <channel_id>
SLACK_OPS_CHANNEL:     <ops_channel_id>
ASSET_STORE_BASE_URL:  https://drive.google.com/... (or S3 bucket URL)
CANVA_TEMPLATE_MAP:    {"instagram": "<designId>", "linkedin": "<designId>", "facebook": "<designId>"}
Integration and API SpecPage 2 of 3
FS-DOC-05Technical

05Error handling and retry logic

All errors are caught at the node level within FullSpec Automation. The standard retry policy is 3 attempts with exponential backoff (2s, 4s, 8s) unless a specific override is noted below. After exhausting retries, the workflow routes to the error handler, which sends a Slack alert to the ops channel and logs the execution ID for manual review.

Error condition
HTTP code / signal
Agent / node
Retry
Fallback action
Webhook HMAC signature mismatch
400 / rejected
Trigger node
None
Drop event; log warning to FullSpec execution log; alert ops channel
Canva OAuth token expired
401 Unauthorized
Channel Formatting Agent
1 retry after auto-refresh
If refresh fails: pause workflow; alert ops to re-authorise Canva credential
Canva export job timeout (>120s)
Job status: failed
Channel Formatting Agent
2 retries with 10s delay
If all retries fail: skip channel, flag post as needs-manual-format, continue other channels
Canva rate limit exceeded
429 Too Many Requests
Channel Formatting Agent
3 retries with 60s backoff
Queue remaining channel exports; process in next execution slot
Buffer 401 token invalid
401 Unauthorized
Scheduling Agent
1 retry after auto-refresh
If refresh fails: halt scheduling; alert ops; post_ids queued for manual schedule
Buffer rate limit hit
429 Too Many Requests
Scheduling Agent
3 retries with 30s backoff
Slow posting cadence to 1 request/3s; remaining posts queued in workflow memory
Buffer profile ID not found
404 Not Found
Scheduling Agent
None
Log missing channel; skip that channel; alert ops to update BUFFER_PROFILE_MAP constant
GA4 quota exceeded
429 / quota error
Reporting Agent (collection)
3 retries with 60s backoff
If all retries fail: postpone report by 1 hour via delayed re-trigger; alert ops
GA4 service account permission denied
403 Forbidden
Reporting Agent (collection)
None
Halt reporting workflow; alert ops to verify service account GA4 property access
Google Sheets write failure
500 / write error
Reporting Agent (output)
3 retries with 5s backoff
If all retries fail: skip Sheets write; proceed to Slack post with inline data only; log error
Slack post message failure
5xx / Slack API error
Reporting Agent (output)
3 retries with 10s backoff
If all retries fail: send plain-text email fallback via FullSpec email node to team distribution list
Durable asset store upload failure
Connection error / 5xx
Channel Formatting Agent
3 retries with 5s backoff
If all retries fail: retain Canva signed URL temporarily and set expiry warning flag; alert ops immediately as URL valid for 1 hour only
Any execution that reaches the error handler emits a Slack alert to the ops channel containing: execution ID, workflow name, failing node name, error code, and a direct link to the FullSpec execution log. This applies to all 12 error conditions above.

06Versioning and change control

All workflow definitions, credential configurations, and field mapping tables are version-controlled. The following table defines the change control process for this integration.

Item
Version control method
Owner
Change process
Workflow JSON exports
Git repository (main branch protected); workflow exported from FullSpec as JSON on every change
Developer
Branch off main; PR review required; merge only after QA pass on staging workflow
Field mapping tables (this doc)
Stored in Git alongside workflow JSON; version number incremented on any field rename or type change
Developer
Update mapping table, increment minor version, notify process owner via PR comment
API credentials and tokens
FullSpec encrypted credential store; no credentials in Git
Developer / process owner
Token rotation follows each tool's recommended rotation schedule; updated in credential store only
Canva template design IDs
Stored as workflow constants in FullSpec env vars; documented in CANVA_TEMPLATE_MAP
Developer
Any new channel or template requires env var update and workflow re-test before activation
Buffer profile ID map
Stored as workflow constant BUFFER_PROFILE_MAP; documented in this spec
Developer
Channel addition or account change: update constant, run Scheduling Agent smoke test, confirm post creation
GA4 property ID
Stored as workflow constant GA4_PROPERTY_ID
Developer
Property change requires GA4_PROPERTY_ID update and Reporting Agent re-validation against new property metadata
This Integration and API Spec (FS-DOC-05)
Versioned in Git; document version in filename suffix (e.g., FS-DOC-05-v1.2.pdf)
Developer
Any tool addition, endpoint change, or field mapping change triggers a document revision and re-issue to stakeholders
Tool plan or API version upgrades
Tracked as a change item in project backlog
Developer / process owner
Impact assessment required before upgrade; staging test mandatory; rollback plan documented before production change
Current document version
1.0
Last reviewed
[Today's Date]
Next scheduled review
30 days after go-live, then quarterly
Change log location
Git repository: /docs/FS-DOC-05/CHANGELOG.md
Any change to an external API endpoint, authentication scope, or field name must be reflected in both the workflow JSON and this document before deployment to production. Breaking changes to upstream APIs (such as a Buffer API version increment or GA4 metric deprecation) must be assessed within 5 business days of vendor announcement.
Integration and API SpecPage 3 of 3

More documents for this process

Every document generated for Social & Digital Promotion.

Launch Plan
Operations · Owner
View
ROI and Business Case
Finance · Owner
View
Process Runbook / SOP
Operations · Owner
View
Developer Handover Pack
Technical · Developer
View
Test and QA Plan
Quality · Developer
View