Health check endpoints
Varmply Backend API (0.1.0)
Varmply API – MVP backend for campaigns, wallets, authentication, and influencer participation.
Common error codes: - NOT_FOUND - Resource not found (404) - VALIDATION_ERROR - Input validation failed (400) - PERMISSION_DENIED - User lacks permission (403) - CONFLICT - Resource conflict (409) - UNAUTHORIZED - Authentication required (401) - INTERNAL_SERVER_ERROR - Unexpected server error (500)
Request
Refreshes metrics (impressions, reach, likes, comments, saves, shares) for a participation's submitted content. Fetches the latest metrics from the social media platform API and creates a snapshot. Requires the participation to have submitted content and the user to have a connected social account with valid OAuth tokens. Returns 200 OK with the created metrics snapshot on success.
- Mock serverhttps://docs-staging.varmply.com/_mock/openapi/metrics/participations/{participationId}/refresh
- Local development serverhttp://localhost:3000/metrics/participations/{participationId}/refresh
- Staging environmenthttps://api-staging.varmply.com/metrics/participations/{participationId}/refresh
- Production environmenthttps://api.varmply.com/metrics/participations/{participationId}/refresh
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs-staging.varmply.com/_mock/openapi/metrics/participations/participation_xyz789/refresh \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Metrics refreshed successfully
Unique identifier for the metrics snapshot
Unique identifier for the participation
External media ID from the social platform (e.g., Instagram post ID, TikTok video ID)
Number of impressions (null for TikTok if unavailable)
Number of unique users reached (null for TikTok if unavailable)
When the metrics were fetched from the platform API
When the snapshot was created
{ "snapshot": { "snapshotId": "snapshot_abc123", "participationId": "participation_xyz789", "externalMediaId": "ABC123", "impressions": 1000, "reach": 850, "likes": 100, "comments": 20, "saves": 50, "shares": 10, "fetchedAtTimestamp": "2024-01-01T12:00:00Z", "createdAtTimestamp": "2024-01-01T12:00:00Z", "lastUpdatedAtTimestamp": "2024-01-01T12:00:00Z" } }
Request
Refreshes metrics for all eligible participations in a campaign. Eligible participations are those with at least one content submission and a status of APPROVED or COMPLETED. Processes participations sequentially and returns a summary of successful and failed refreshes. Only the campaign owner can refresh metrics for their campaign. Returns 200 OK with the refresh summary on success.
- Mock serverhttps://docs-staging.varmply.com/_mock/openapi/metrics/campaigns/{campaignId}/refresh
- Local development serverhttp://localhost:3000/metrics/campaigns/{campaignId}/refresh
- Staging environmenthttps://api-staging.varmply.com/metrics/campaigns/{campaignId}/refresh
- Production environmenthttps://api.varmply.com/metrics/campaigns/{campaignId}/refresh
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs-staging.varmply.com/_mock/openapi/metrics/campaigns/campaign_abc123/refresh \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{ "campaignId": "campaign_abc123", "totalEligibleParticipationCount": 5, "successfulCount": 4, "failedCount": 1, "failedParticipationIdList": [ "participation_xyz789" ] }