Skip to content
campaiDeveloper
campai.com

Crm · Social posts

POST/{organizationId}/crm/communication/socialPosts/{postId}/deliveries/{accountId}/statistics/refresh

Refresh post statistics

Requests a refresh of a social post’s statistics for one account. It takes organizationId, postId, and accountId, and returns postId. The account’s figures may also be refreshed.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access and the social.edit permission.

Request

Path parameters

  • organizationIdidrequired
  • postIdidrequired
  • accountIdidrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/crm/communication/socialPosts/YOUR_POST_ID/deliveries/YOUR_ACCOUNT_ID/statistics/refresh' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • postIdid
Response200
{
  "postId": "000000000000000000000001"
}

What else happens

  • When the statistics are refreshable, the endpoint sets nextFetchAt to the current time on the socialPostMetrics record.
  • The endpoint submits crm.refreshSocialPostMetrics to DefaultQueue after saving the refresh request. A queue submission failure is caught.
  • If the latest account metrics have no update time or were updated at least 15 minutes ago, the endpoint submits crm.refreshSocialAccountMetrics to DefaultQueue. A queue submission failure is caught.

Errors

Other errors

StatusErrorWhen
409Connect the channel again to refresh its statistics.If the account is missing or not connected, the endpoint returns HTTP 409 CONFLICT with key socialPost.statisticsAccountNotConnected.
409The statistics of this publication cannot be refreshed now. They can be refreshed once every 15 minutes.If the account is connected but statistics are missing, have no refresh time, or are not yet refreshable, the endpoint returns HTTP 409 CONFLICT with key socialPost.statisticsNotRefreshable.

Errors nearly every request can meet are listed under Errors.