staqlydocs
REST APIAPI referencePosts

Your own automation sends the numbers of a post it published

Your own automation sends the numbers of a post it published (posts:publish)

Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.

PUT
/v1/posts/{id}/targets/{channel}/metrics

Only targets on a channel of provider custom (422 otherwise). Replaces the stored numbers.

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Path Parameters

id*string
channel*string

The channel id of the target

Header Parameters

Idempotency-Key?string

Replays the stored response when the same key is repeated with the same method, path, query string and body within 24 hours (422 idempotency_mismatch with a different request, 409 idempotency_in_progress while the first one runs). Not applied to multipart uploads or to responses that carry a secret.

Lengthlength <= 200

Request Body

application/json
  1. body

A post's numbers on one platform; a missing field is a number the platform does not give

impressions?integer
Range0 <= value
likes?integer
Range0 <= value
reposts?integer
Range0 <= value
replies?integer
Range0 <= value
quotes?integer
Range0 <= value
bookmarks?integer
Range0 <= value
link_clicks?integer
Range0 <= value

Response Body

OK

application/json
  1. response
channel_id*string
channel_name*string
provider*string
status*string
external_url*string
available*boolean

The platform reports numbers (or your automation sends them)

metrics*|null
updated_at*|
Formatdate-time
error?string

Why the last read failed

curl -X PUT 'https://staqly.example.com/v1/posts/string/targets/string/metrics' \  -H 'Content-Type: application/json' \  -d '{}'
{  "channel_id": "string",  "channel_name": "string",  "provider": "string",  "status": "string",  "external_url": "string",  "available": true,  "metrics": {    "impressions": 0,    "likes": 0,    "reposts": 0,    "replies": 0,    "quotes": 0,    "bookmarks": 0,    "link_clicks": 0  },  "updated_at": "2019-08-24T14:15:22Z",  "error": "string"}