Create Audience From Cluster
Creates an audience from cluster
Getting Started
https://api.statsocial.com/platform/v0/audiences/{audience_id}/insights/{cluster_id}
Parameters
If the caller has the choose_outputs
permission, they can, optionally, choose the outputs of the audience in the outputs
array.
If the outputs are not specified, the outputs generated will be the same as the caller's can_generate
permissions.
If the caller does not have the choose_outputs
permission, the outputs will be chosen based on the caller's permissions to generate outputs and the outputs
array will be ignored.
All permissions are managed by StatSocial.
The available output types are: ss_id
, twitter_id
, twitter_user
, md5
, email_raw
, cint_id
, ma_id
.
Even if the caller has the choose_outputs
permission and doesn't specify the ss_id
output in the outputs array, it will always be present.
{
"outputs": ["md5", "ss_id"]
}
Callback
The caller can, optionally, send a callback URL in the request that will be called by the Silhouette API via a POST
request once the build process is complete.
Since the callback is optional, the caller can keep hitting the Get Audience Data
endpoint in order to check the build status.
The payload sent via the callback signal is exactly the same that would be returned if the caller had hit the Get Audience Data
endpoint.
{
"callback_url":"https://yoursite.com/callback"
}
Insight auto generation
Endpoint allows generating automatically insight, by passing generate_insights_automatically=true.
In this case additional parameter for insight callback is allowed insight_callback_url
By default insights are not generated automatically
{
"generate_insights_automatically": true,
"insight_callback_url": "https://my.callback/insight/endpoint",
}
Let's go to examples
https://api.statsocial.com/platform/v0/audiences/321321/insight/clusters/1
With the payload like:
{
"outputs": ["md5", "ss_id"],
"callback_url": "http://yourcallback.com/lorem",
"insights_callback_url": "http://yourcallback.com/ipsum",
"generate_insights_automatically": true
}
We will receive a json like this
{
"response": {
"id": 1,
"status": "running"
},
"information": {
"version": "0.0.1"
}
}